You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When appending a captured command output to an existing HTML file, we ask the rich library Console.export_html() API to generate inline CSS styles rather than:
CSS class definitions in a <style> element
which the <span>s making the actual output will later point to using class identifiers
This is handy: we don't have to deal with merging existing classes and new HTML elements, with overlapping identifiers.
Unfortunately, Web browsers will render the linked texts generated by the rich library (e.g. a compatible string linked to a YAML binding file) with their default style for unvisited links (typically blue), instead of the expected style (e.g. the one consistently used for compatible strings).
This results in ugly/confusing HTML files.
We submitted a patch to the upstream rich library project [1].
When appending a captured command output to an existing HTML file,
we asked the rich library Console.export_html() API to generate
inline CSS styles rather than:
- CSS class definitions in a <style> element
- which the <span>s making the actual output will later point to
using class identifiers
This was handy: we didn't have to deal with "merging" existing classes
and new HTML elements, both 1-indexed and overlapping.
Unfortunately, the HTML generated by the rich library
will render linked texts (e.g. a compatible string linked
to a YAML binding file) with the Web browser's default style
for unvisited links (typically blue),
instead of the expected style (e.g. the one consistently used
for compatible strings).
This can produce ugly/confusing outputs [1].
We submitted a patch to the upstream rich library project [2].
This commit relies on dtsh.rich.html to decouple DTSh command
output redirection to HTML files from the inline styles generated
by the rich library.
We may keep this approach even if the initial issue is fixed upstream.
[1] #9
[2] Textualize/rich#3580
When appending a captured command output to an existing HTML file, we ask the rich library
Console.export_html()
API to generate inline CSS styles rather than:<style>
element<span>
s making the actual output will later point to using class identifiersThis is handy: we don't have to deal with merging existing classes and new HTML elements, with overlapping identifiers.
Unfortunately, Web browsers will render the linked texts generated by the rich library (e.g. a compatible string linked to a YAML binding file) with their default style for unvisited links (typically blue), instead of the expected style (e.g. the one consistently used for compatible strings).
This results in ugly/confusing HTML files.
We submitted a patch to the upstream rich library project [1].
[1] Textualize/rich#3580
The text was updated successfully, but these errors were encountered: