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 | 339f3402f1e18c2175a90d168c707a7dcbd966e4 (patch) | |
tree | 91e0bbb49bb5a95a958bdc1314f1fdbe2cc5c2e4 /coverage/htmlfiles | |
parent | 7e10f782544e6f628c53f6ac64d510d0e2fef0af (diff) | |
download | python-coveragepy-git-339f3402f1e18c2175a90d168c707a7dcbd966e4.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 fb8e131e..b8336760 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> |