diff options
Diffstat (limited to 'coverage/html.py')
-rw-r--r-- | coverage/html.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/coverage/html.py b/coverage/html.py index 91ae2c27..0829f219 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -67,6 +67,7 @@ class HtmlReporter(Reporter): self.directory = None self.template_globals = { 'escape': escape, + 'pair': pair, 'title': self.config.html_title, '__url__': coverage.__url__, '__version__': coverage.__version__, @@ -379,3 +380,7 @@ def spaceless(html): """ 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 |