aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/tidy/test.py4
-rw-r--r--python/tidy/tidy.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/python/tidy/test.py b/python/tidy/test.py
index 490c77edec9..92f9494013f 100644
--- a/python/tidy/test.py
+++ b/python/tidy/test.py
@@ -70,8 +70,8 @@ class CheckTidiness(unittest.TestCase):
def test_whatwg_link(self):
errors = tidy.collect_errors_for_files(iterFile('whatwg_link.rs'), [], [tidy.check_by_line], print_text=False)
- self.assertTrue('link to WHATWG may break in the future, use this format instead:' in next(errors)[2])
- self.assertTrue('links to WHATWG single-page url, change to multi page:' in next(errors)[2])
+ self.assertEqual('link to WHATWG may break in the future, use this format instead: https://html.spec.whatwg.org/multipage/#dom-context-2d-putimagedata', next(errors)[2])
+ self.assertEqual('links to WHATWG single-page url, change to multi page: https://html.spec.whatwg.org/multipage/#typographic-conventions', next(errors)[2])
self.assertNoMoreErrors(errors)
def test_license(self):
diff --git a/python/tidy/tidy.py b/python/tidy/tidy.py
index 584291c5ccf..1833db51187 100644
--- a/python/tidy/tidy.py
+++ b/python/tidy/tidy.py
@@ -271,14 +271,14 @@ def is_unsplittable(file_name, line):
def check_whatwg_specific_url(idx, line):
match = re.search(br"https://html\.spec\.whatwg\.org/multipage/[\w-]+\.html#([\w\'\:-]+)", line)
if match is not None:
- preferred_link = "https://html.spec.whatwg.org/multipage/#{}".format(match.group(1))
+ preferred_link = "https://html.spec.whatwg.org/multipage/#{}".format(match.group(1).decode("utf-8"))
yield (idx + 1, "link to WHATWG may break in the future, use this format instead: {}".format(preferred_link))
def check_whatwg_single_page_url(idx, line):
match = re.search(br"https://html\.spec\.whatwg\.org/#([\w\'\:-]+)", line)
if match is not None:
- preferred_link = "https://html.spec.whatwg.org/multipage/#{}".format(match.group(1))
+ preferred_link = "https://html.spec.whatwg.org/multipage/#{}".format(match.group(1).decode("utf-8"))
yield (idx + 1, "links to WHATWG single-page url, change to multi page: {}".format(preferred_link))