diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-11-27 12:23:41 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-11-27 12:23:41 -0800 |
commit | ab37be988c414646fa4813af9cf1ee0823a436fe (patch) | |
tree | 0503f33508737adfc33b33d9d5ace515b7c4095f | |
parent | 100c27759aa1906a39791292539832529e2cae5c (diff) |
runtests.py: renamed a regex.
-rwxr-xr-x | runtests.py | 5 |
1 files changed, 3 insertions, 2 deletions
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: |