Skip to content

Fix line numbers hiding code in fancy-code block styling#188

Open
Febulix wants to merge 2 commits into
colineckert:mainfrom
Febulix:fix-codeblock-line-numbers
Open

Fix line numbers hiding code in fancy-code block styling#188
Febulix wants to merge 2 commits into
colineckert:mainfrom
Febulix:fix-codeblock-line-numbers

Conversation

@Febulix

@Febulix Febulix commented Oct 28, 2025

Copy link
Copy Markdown

In “fancy-code” blocks, the first two characters of code were being hidden behind the line numbers.

This small update ensures all code is fully visible and accommodates three-digit line numbers.

The fix modifies only two lines:
width of the line-number pseudo-element ::before increased from 1.7em2.1em
padding-left of code lines changed from 2.8em2.6em !important
The use of !important on padding-left ensures it overrides other theme styles and reliably prevents the overlap.

@Febulix

Febulix commented Oct 28, 2025

Copy link
Copy Markdown
Author

Oh, sorry! I didn’t notice bug report #186 or the fix in #187 by @moziar when I submitted my pull request. 🙈
I prefer the solution in #187, but it would be great to keep the spacing changes so that line numbers can go up to three digits.

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.

1 participant