diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-05-04 21:47:17 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-05-04 21:47:17 -0400 |
commit | 85e43adf3dcc94566b27164bd7a9cb8e456fe4bd (patch) | |
tree | d8b858edec5b1d7646a194fa407f3335ce8b1c0d /coverage/html.py | |
parent | bc01aa82772ba24aadc751465194a5f4430903d3 (diff) | |
download | python-coveragepy-85e43adf3dcc94566b27164bd7a9cb8e456fe4bd.tar.gz |
The HTMLifier didn't deal with runs of spaces with an odd number of spaces properly.
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 d34aeac..6fc49ff 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(" ", " ") ) |