Skip to content

Commit

Permalink
Fix line wrap for code/pre blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaegel committed Nov 20, 2023
1 parent 5b97153 commit 623fd8e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions themes/custom/static/css/pygment.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
code {
overflow: auto;
/*
* This uses `white-space: pre-wrap` to get elements within <pre> tags to wrap.
* Python, for code chunks within three backticks (```), doesn't wordwrap code lines by default,
* because they're within <pre> tags, which don't wrap by default.
* See https://github.com/github/markup/issues/168 , which is specifically about this parsing issue,
* even though that link's discussion is talking about GitHub.
*/
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}

td.linenos .normal {
color: inherit;
background-color: transparent;
Expand Down

0 comments on commit 623fd8e

Please sign in to comment.