From 2d4ebdde563b5a8abb0f9e3b499eef61bd66e8a5 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 4 May 2009 21:47:17 -0400 Subject: The HTMLifier didn't deal with runs of spaces with an odd number of spaces properly. --- coverage/html.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'coverage/html.py') diff --git a/coverage/html.py b/coverage/html.py index d34aeac7..6fc49ff5 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -132,8 +132,13 @@ class HtmlReporter(Reporter): def escape(t): """HTML-escape the text in t.""" return (t + # Convert HTML special chars into HTML entities. .replace("&", "&").replace("<", "<").replace(">", ">") .replace("'", "'").replace('"', """) + # Convert runs of spaces: " " -> "      " + .replace(" ", "  ") + # To deal with odd-length runs, convert the final pair of spaces + # so that " " -> "     " .replace(" ", "  ") ) -- cgit v1.2.1