fix: allow long text to wrap in table cells#13
Conversation
- Remove white-space: nowrap from th and td:first-child - Add word-break, overflow-wrap, hyphens for proper wrapping - Fixes German compound words overflowing cell boundaries - Keeps table-layout: fixed for consistent column widths
|
Caution Review failedThe pull request is closed. WalkthroughTable header and cell styles in the markdown CSS were changed to allow wrapping: nowrap/ellipsis constraints were removed and word-break, overflow-wrap, and hyphenation properties were added so table content can wrap across lines. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/shared/styles/markdown.css (1)
273-276: Consider removing redundantword-wrapproperty.Line 273 contains
word-wrap: break-word, while line 275 addsoverflow-wrap: anywhere. Sinceword-wrapis the legacy alias foroverflow-wrap, having both is redundant. The neweroverflow-wrap: anywherewill take precedence.🔎 Apply this diff to remove the redundant property:
.markdown-body td { padding: 8px 16px; border: 1px solid var(--border-color); vertical-align: top; text-align: left !important; - word-wrap: break-word; word-break: break-word; overflow-wrap: anywhere; hyphens: auto; }Alternatively, if you want to keep
word-wrapas a fallback for older browsers, ensure it matches theoverflow-wrapvalue:.markdown-body td { padding: 8px 16px; border: 1px solid var(--border-color); vertical-align: top; text-align: left !important; - word-wrap: break-word; + word-wrap: anywhere; word-break: break-word; overflow-wrap: anywhere; hyphens: auto; }
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/shared/styles/markdown.css(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
packages/shared/styles/**/*.css
📄 CodeRabbit inference engine (AGENTS.md)
Shared styles must be placed in packages/shared/styles/ and organized into theme.css (CSS variables), markdown.css (rendered markdown), and print.css files
Files:
packages/shared/styles/markdown.css
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: test
- GitHub Check: build-check
🔇 Additional comments (1)
packages/shared/styles/markdown.css (1)
263-265: Ensurehyphens: autoworks for German text by setting the correctlangattribute.The text wrapping properties look good. However,
hyphens: autorequires a matchinglangattribute to function—currently the HTML haslang="en", which won't enable German hyphenation. For proper German word-breaking and hyphenation support, either:
- Set
lang="de"on the.markdown-bodyelement or dynamically based on content language- Or apply language-specific hyphens rules to the markdown content container
- Remove word-wrap (legacy alias, overflow-wrap suffices) - Remove hyphens: auto (needs lang attribute to work properly)
Problem
Long text (especially German compound words) was overflowing table cell boundaries because of
white-space: nowraprules.Solution
white-space: nowrapfromthandtd:first-childword-break: break-word,overflow-wrap: anywhere,hyphens: autofor proper wrappingtable-layout: fixedfor consistent column widths across stacked tablesTesting
Tested with German financial tables containing long compound words like "Naturschutzmaßnahmen" and "Flächenbewirtschaftung".
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.