Commit 8dd8043
committed
Harden HTML report rendering
Escape generated HTML without allocating DOM nodes, including attribute
quotes. The previous DOM-based `escapeHTML` only handled `&`, `<`, and
`>`, so a filename containing `"` or `'` could break out of a `title=`
attribute. Preserve real 0% branch and method coverage values in the
file-row renderer instead of treating them as falsy and substituting
the 100% fallback used for disabled criteria.
Add small `getThemePreference` / `setThemePreference` helpers around
`localStorage` so the toggle click and the prefers-color-scheme listener
match the head-script preflight's try/catch. localStorage can throw in
Safari private mode, sandboxed iframes, and browsers with storage
disabled, and the previous direct calls would crash dark-mode interaction
in those contexts.
Precompute sort keys before row reordering, avoid large spread appends,
simplify filter parsing and class updates, harden the dark-mode
preflight, and rebuild the public formatter assets. CHANGELOG entries
under Bugfixes document the attribute-escape and 0%-display fixes.1 parent 3de2abd commit 8dd8043
5 files changed
Lines changed: 175 additions & 122 deletions
File tree
- html_frontend/src
- lib/simplecov/formatter/html_formatter/public
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
0 commit comments