Description
Is your feature request related to a problem? Please describe.
In #6, it was reported that \t
get handled in HTML reports.
When checking html.py
this mentioned code seams to be gone.
When using tab characters for indentation in Python files, coverage.py converts all tabs to 8 spaces (checked in Chrome browser).
When checking the HTML source code, then 8 spaces can be found:
HTML Code | HTML View |
---|---|
![]() |
![]() |
Describe the solution you'd like
Offer an option in the configuration file, so the conversion of tab characters to spaces can be specified.
[html]
tabstyle = spaces
tabsize = 2
Or this
[html]
tabstyle = tabs
tabsize = 2
This would allow CSS to specify the representation with a default of 2
.
Describe alternatives you've considered
-
The documentation contains no options to configure the tab to space translation process.
-
I think modifying CSS is not possible, because the HTML code contains already 8 spaces.
So the representation of tab characters can't be modified.#source { padding: 1em 0 1em 3.5rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; } #source p { position: relative; white-space: pre; } #source p * { box-sizing: border-box; } #source p .t { display: inline-block; width: 100%; box-sizing: border-box; margin-left: -.5em; padding-left: 0.3em; border-left: 0.2em solid #fff; }
Additional context
- CSS settings for tab sizes: https://developer.mozilla.org/de/docs/Web/CSS/tab-size
tab-size: 2;
/cc @umarcor