diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-06-11 17:17:02 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-06-16 17:46:53 -0700 |
commit | 50d3b871ad9f63907c5b19bb478aae0b6c1247a4 (patch) | |
tree | e34c6eb7e58a899fae84023de8448301bd166085 /test | |
parent | 7e7819e05ec91bc7ca7859d119f1274cf3a83913 (diff) |
normalize.py: don't collapse whitespace in pre contexts.
Diffstat (limited to 'test')
-rw-r--r-- | test/normalize.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/normalize.py b/test/normalize.py index 03d958e..70bee46 100644 --- a/test/normalize.py +++ b/test/normalize.py @@ -21,7 +21,8 @@ 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 = whitespace_re.sub(' ', data) + if not self.in_pre: + data = whitespace_re.sub(' ', data) if after_block_tag and not self.in_pre: if self.last == "starttag": data = data.lstrip() |