Skip to content

Fix/1698 lineos wrapping#1701

Merged
Anteru merged 7 commits intomasterfrom
fix/1698-lineos-wrapping
Feb 12, 2021
Merged

Fix/1698 lineos wrapping#1701
Anteru merged 7 commits intomasterfrom
fix/1698-lineos-wrapping

Conversation

@Anteru
Copy link
Copy Markdown
Collaborator

@Anteru Anteru commented Feb 6, 2021

This changes the HTML/CSS a bit so I'd appreciate a second set of eyes. See #1698 for details, but here's the gist:

  • This changes the wrapping order such that line numbers are inside the highlighting span, instead of outside
  • This changes the default CSS for line numbers to be "neutral" w.r.t. to the rest of the line. This seems to look better on dark styles.

The full fix is to go through all styles individually and set the line number/special line number color to something sensible, but the current solution should work reasonably well.

Instead of hardcoding black/light gray, use transparent/inherit which
makes it "neutral" out of the box. linenospecial is still hard-coded and
may look wrong, but that needs fixing in the style.
@Anteru Anteru added this to the 2.8 milestone Feb 6, 2021
@Anteru Anteru requested a review from birkenfeld February 6, 2021 12:49
The padding would get applied twice to "special" lines, once via
<pre>, once via the <span>, which was not consistent with inline
line numbers where the .special style would override the default
style.

To fix this, we now emit "normal" and "special" lines for td.linenos
line numbers, and the normal style is applied to "normal". This brings
td.linenos closer to inline line numbers, and also makes the styling
between noclasses=True and noclasses=False consistent.
This was referenced Feb 7, 2021
@birkenfeld
Copy link
Copy Markdown
Member

This is bound to mess up someone's custom CSS, but I guess if it fixes issues that is acceptable?

@Anteru
Copy link
Copy Markdown
Collaborator Author

Anteru commented Feb 12, 2021

Pretty much yes. But Sphinx seems to be an important enough customer and it's broken right now, so I'd rather fix Sphinx and brake some random CSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants