Fix link issue under Windows.
authorfunilrys <redacted>
Sun, 23 Feb 2020 11:37:34 +0000 (12:37 +0100)
committerfunilrys <redacted>
Sun, 23 Feb 2020 11:37:34 +0000 (12:37 +0100)
We never saw this, as we are not Windows user ourselves but there is
a real issue.

Indeed, as mentionned by @XhmikosR at
https://github.com/StevenBlack/hosts/pull/1163#issuecomment-590057635
the web links are not correctly formated. Indeed, as we use `sep` to
detect the right directory separator, it's also written into the
`readmeData.json` file.

This patch simply, replace the `\` of Windows, with the universal `/` of
the web convention.

updateReadme.py

index f99df81be87e6b6e78d7e9fa0e035560d50b5242..34baf2c1f9a7aa15ee593700c42f89eb3e5fb979 100644 (file)
@@ -45,6 +45,9 @@ def main():
                 "Unified hosts **+ " + key.replace("-", " + ") + "**"
             )
 
+        if "\\" in data[key]["location"]:
+            data[key]["location"] = data[key]["location"].replace("\\", "/")
+
         toc_rows += s.substitute(data[key]) + "\n"
 
     row_defaults = {
git clone https://git.99rst.org/PROJECT