diff options
| author | Oleh Krehel <ohwoeowho@gmail.com> | 2023-03-22 17:42:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-22 09:42:35 -0700 |
| commit | d6cb1cdca6d15f5ec02eb6708314589290321faf (patch) | |
| tree | 1cf7f910a9e9b1b1ad7f1a40dad59231da4e0d42 /coverage/htmlfiles/pyfile.html | |
| parent | 551522eb214ad0c3f1dc48cd112a4f0ba6ddc6b6 (diff) | |
| download | python-coveragepy-git-d6cb1cdca6d15f5ec02eb6708314589290321faf.tar.gz | |
fix: put contexts dict in <script> and reveal them using JavaScript (#1587)
* Put contexts dict in <script> and reveal them using JavaScript
Fixes #1584
* Address review comments
* coverage/htmlfiles/style.css: Align the contexts to the right
* coverage/htmlfiles/style.scss: Match style.css
* coverage/html.py: Fix linting and mypy errors
* two_tests_py.html: make update-gold
Diffstat (limited to 'coverage/htmlfiles/pyfile.html')
| -rw-r--r-- | coverage/htmlfiles/pyfile.html | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html index 8fcfc660..1921e1c2 100644 --- a/coverage/htmlfiles/pyfile.html +++ b/coverage/htmlfiles/pyfile.html @@ -11,6 +11,13 @@ {% if extra_css %} <link rel="stylesheet" href="{{ extra_css }}" type="text/css"> {% endif %} + + {% if contexts_json %} + <script type="text/javascript"> + contexts = {{ contexts_json }} + </script> + {% endif %} + <script type="text/javascript" src="coverage_html.js" defer></script> </head> <body class="pyfile"> @@ -117,11 +124,9 @@ {% endif %} </span> {# Things that should appear below the line. #} - {% if line.context_list %} + {% if line.context_str %} <span class="ctxs"> - {% for context in line.context_list %} - <span>{{context}}</span> - {% endfor %} + {{ line.context_str }} </span> {% endif %} </p> |
