From 339f3402f1e18c2175a90d168c707a7dcbd966e4 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 15 Feb 2016 15:27:36 -0500 Subject: Use templite's whitespace slurping to avoid post-processing the HTML --- coverage/html.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'coverage/html.py') diff --git a/coverage/html.py b/coverage/html.py index 7567c605..a7a92095 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+

\n