diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-02-15 15:27:36 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-02-15 15:27:36 -0500 |
commit | bcd5a878e6d5d7483871b49e7b275855af08fa46 (patch) | |
tree | 00965ae2d902d64a4bd20f90c99cadb3770915b8 /coverage/html.py | |
parent | 4f83c4c7eb883769ecdbd407502d04bf0825cd0e (diff) | |
download | python-coveragepy-bcd5a878e6d5d7483871b49e7b275855af08fa46.tar.gz |
Use templite's whitespace slurping to avoid post-processing the HTML
Diffstat (limited to 'coverage/html.py')
-rw-r--r-- | coverage/html.py | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/coverage/html.py b/coverage/html.py index 7567c60..a7a9209 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -263,7 +263,7 @@ class HtmlReporter(Reporter): 'fr': fr, 'nums': nums, 'lines': lines, 'time_stamp': self.time_stamp, } - html = spaceless(self.source_tmpl.render(template_values)) + html = self.source_tmpl.render(template_values) html_filename = rootname + ".html" html_path = os.path.join(self.directory, html_filename) @@ -426,17 +426,6 @@ def escape(t): return t.replace("&", "&").replace("<", "<") -def spaceless(html): - """Squeeze out some annoying extra space from an HTML string. - - Nicely-formatted templates mean lots of extra space in the result. - Get rid of some. - - """ - html = re.sub(r">\s+<p ", ">\n<p ", html) - return html - - def pair(ratio): """Format a pair of numbers so JavaScript can read them in an attribute.""" return "%s %s" % ratio |