From ab37be988c414646fa4813af9cf1ee0823a436fe Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 27 Nov 2014 12:23:41 -0800 Subject: runtests.py: renamed a regex. --- runtests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtests.py') diff --git a/runtests.py b/runtests.py index 92feeed..5d04818 100755 --- a/runtests.py +++ b/runtests.py @@ -64,7 +64,7 @@ def md2html(text, prog): # Normalization code, adapted from # https://github.com/karlcow/markdown-testsuite/ significant_attrs = ["alt", "href", "src", "title"] -normalize_whitespace_re = re.compile('\s+') +whitespace_re = re.compile('/s+/') class MyHTMLParser(HTMLParser): def __init__(self): HTMLParser.__init__(self) @@ -77,7 +77,7 @@ class MyHTMLParser(HTMLParser): after_block_tag = after_tag and self.is_block_tag(self.last_tag) if after_tag and self.last_tag == "br": data = data.lstrip('\n') - data = normalize_whitespace_re.sub(' ', data) + data = whitespace_re.sub(' ', data) if after_block_tag and not self.in_pre: if self.last == "starttag": data = data.lstrip() @@ -290,6 +290,7 @@ def do_tests(specfile, prog, pattern, normalize, dump_tests): markdown_lines.append(line) elif state == 2: html_lines.append(line) + if dump_tests: print json.dumps(tests_json, ensure_ascii=False, indent=2) else: -- cgit v1.2.3