Skip to content

Line Number doesn't render all the way #7639

Answered by kamilkrzyskow
kenny-chua asked this question in Q&A
Discussion options

You must be logged in to vote

Aha, this CSS wraps the text when it's too long:

pre, code {
    white-space: pre-wrap; /* CSS property to make text wrap */
    word-break: break-word; /* Ensures words break properly */
    overflow-wrap: break-word; /* Breaks long words if necessary */
}

and the line numbers are static, generated in HTML, what happens is that you increase the amount of lines in the code block, while not adjusting the line numbers, so in the end they cut off at random points, because different files add more lines than the other.

I don't think you can fix it with pure CSS 🤔 The only idea I have currently would be to use JavaScript to fetch the calculated height of the newly wrapped line and then overri…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@kenny-chua
Comment options

@kenny-chua
Comment options

@kamilkrzyskow
Comment options

Answer selected by kenny-chua
@kenny-chua
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants