nimdoc: CSS: fix rendering of inline code spans (#25605)

I've been wondering why the inline code was rendered wrapped with no
regards to words/whitespace for a while.

Partially reverts 8b82f5 (#24927)

- `word-break: break-all;` This is seriously wrong, replaced with
`overflow-wrap: break-word;`
- `white-space: normal;` -> `pre-wrap;` to preserve whitespace in code
spans.
- Added `display: block;` and `overflow-x: auto;` to tables. This
contains wide tables with their own scrollbars without stretching the
whole doc.
- `overflow-x: hidden;` just clips content and possibly conflicts with
navbar's `sticky` attribute. Removed.
This commit is contained in:
Zoom
2026-03-16 21:05:11 +04:00
committed by GitHub
parent d0919b6df8
commit b494147310
2 changed files with 8 additions and 6 deletions

View File

@@ -123,7 +123,6 @@ Modified by Boyd Greenfield and narimiran
}
html {
overflow-x: hidden;
max-width: 100%;
box-sizing: border-box;
font-size: 100%;
@@ -572,8 +571,8 @@ blockquote.markdown-quote {
padding-left: 3px;
padding-right: 3px;
border-radius: 4px;
white-space: normal;
word-break: break-all;
white-space: pre-wrap;
overflow-wrap: break-word;
}
span.tok {
@@ -674,6 +673,8 @@ table {
border-collapse: collapse;
border-color: var(--third-background);
border-spacing: 0;
display: block;
overflow-x: auto;
}
table:not(.line-nums-table) {

View File

@@ -123,7 +123,6 @@ Modified by Boyd Greenfield and narimiran
}
html {
overflow-x: hidden;
max-width: 100%;
box-sizing: border-box;
font-size: 100%;
@@ -572,8 +571,8 @@ blockquote.markdown-quote {
padding-left: 3px;
padding-right: 3px;
border-radius: 4px;
white-space: normal;
word-break: break-all;
white-space: pre-wrap;
overflow-wrap: break-word;
}
span.tok {
@@ -674,6 +673,8 @@ table {
border-collapse: collapse;
border-color: var(--third-background);
border-spacing: 0;
display: block;
overflow-x: auto;
}
table:not(.line-nums-table) {