fix: default HR styling from background-color
to border-top
#10535
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi all,
I propose to change the way horizontal rules are styled in HTML exports from applying a
background-color
to usingborder-top
. This change does not affect how they are displayed; so all exports will still look like before.However, this way, horizontal rules will be printed out if someone decides to save a document exported to HTML to PDF or print it.
Why?
I just had a user mentioning that, if you use a horizontal rule in a document, export it to HTML and then print it, the horizontal rule doesn't show up (see Zettlr/Zettlr#5562). After some fiddling around, I found that in the styles section, Pandoc applies a background instead of a border color. By default, every browser will not print backgrounds to save toner/ink, which applies even if someone wants to save down a PDF file.
In my specific case, it affects the way Zettlr's "Simple PDF" exporter works (which literally exports to HTML and then "prints" it using Chromium's HTML-to-PDF converter), but I believe that changing this will yield benefits for anyone using Pandoc to export to HTML. In addition, using a border color rather than a background color brings horizontal rule styling closer to how these elements are styled by default in a browser (using borders, not backgrounds).
Caveats
This PR does not affect the way horizontal rules are displayed, only how browsers treat them during PDF export/printing.
However, I want to note that this PR would necessitate minimal changes to two other open PRs: