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/htmlfiles | |
parent | 4f83c4c7eb883769ecdbd407502d04bf0825cd0e (diff) | |
download | python-coveragepy-bcd5a878e6d5d7483871b49e7b275855af08fa46.tar.gz |
Use templite's whitespace slurping to avoid post-processing the HTML
Diffstat (limited to 'coverage/htmlfiles')
-rw-r--r-- | coverage/htmlfiles/pyfile.html | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html index fb8e131..b833676 100644 --- a/coverage/htmlfiles/pyfile.html +++ b/coverage/htmlfiles/pyfile.html @@ -71,13 +71,21 @@ <table> <tr> <td class="linenos"> - {% for line in lines %} + {% for line in lines -%} <p id="n{{line.number}}" class="{{line.class}}"><a href="#n{{line.number}}">{{line.number}}</a></p> {% endfor %} </td> <td class="text"> - {% for line in lines %} - <p id="t{{line.number}}" class="{{line.class}}">{% if line.annotate %}<span class="annotate short">{{line.annotate}}</span><span class="annotate long">{{line.annotate_long}}</span>{% endif %}{{line.html}}<span class="strut"> </span></p> + {# These are the source lines, which are very sensitive to whitespace. #} + {# The `{ # - # }` below are comments which slurp up the following space. #} + {% for line in lines -%} + <p id="t{{line.number}}" class="{{line.class}}">{#-#} + {% if line.annotate -%} + <span class="annotate short">{{line.annotate}}</span>{#-#} + <span class="annotate long">{{line.annotate_long}}</span>{#-#} + {% endif -%} + {{line.html}}<span class="strut"> </span>{#-#} + </p> {% endfor %} </td> </tr> |