Skip to content

fix: code in a table cell no longer breaks mid-word - #8

Merged
burinc merged 2 commits into
mainfrom
fix/table-code-no-midword-wrap
Nov 18, 2026
Merged

burinc merged 2 commits into
mainfrom
fix/table-code-no-midword-wrap

Conversation

@burinc

@burinc burinc commented Nov 17, 2026

Copy link
Copy Markdown
Member

Inline code gets overflow-wrap: anywhere so a long identifier can wrap in prose. Inside a table that same rule lets the browser shrink a code column until names split one character at a time, so cui_app_create shows up as cui_app_creat / e.

This adds one rule to resources/static/css/screen.css: code in a td or th keeps overflow-wrap: normal and white-space: nowrap. The prose columns wrap instead. A table too wide for the page scrolls, since .doc-content table already has overflow-x: auto.

Found on kaew's core guide, in the table of functions that return raw pointers. Before, the C names and return types broke mid-word. After, each one stays on a single line and the reason column wraps.

bb test passes (111 tests, 293 assertions). It's CSS only, so I checked it by building kaew's site against this branch (DOCS_ENGINE=…/docs-engine jolt site:build) and comparing screenshots in headless Chrome with and without the rule.

Inline code has overflow-wrap: anywhere so long identifiers wrap in
prose, but inside a table it lets the browser shrink a code column
until names split one character at a time (cui_app_c / reate). Code in
td and th now stays on one line, and a table too wide for the page
scrolls, as .doc-content table already allows with overflow-x: auto.
With code cells kept on one line, a 420px viewport squeezed the prose
column to one word per line and each row grew to about 370px tall. Below
760px, cells in a table that holds code get a 14rem minimum width, so the
prose wraps at a readable width and the table scrolls sideways.
@burinc
burinc merged commit 7af2aaf into main Nov 18, 2026
1 check passed
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