THE GITHTML FIELD GUIDE

Undo aggressive word breaking in mixed-language prose

If words split at arbitrary letters, inspect word-break rules inherited from an overflow fix. A global break-all rule can damage readability in ordinary prose, while keep-all can affect CJK wrapping differently. Choose language-appropriate behavior and scope emergency wrapping to long technical strings rather than applying one rule to every passage.

Identify the specific failure

A fix intended for a long identifier may reach all paragraphs through inheritance. The page fits, but English words break unnaturally and mixed-language passages become difficult to scan. Width alone is therefore an incomplete success criterion.

Make a narrow correction

Restore normal word breaking for prose and handle exceptional strings separately. Review actual Chinese, Japanese, or Korean text with someone familiar with the language when those languages are in scope. Do not infer correctness from a Latin-only placeholder.

  1. Locate inherited word-break declarations before editing individual paragraphs.
  2. Scope emergency wrapping to the exceptional strings that require it.
  3. Review real multilingual examples instead of relying on one global overflow rule.
css
.prose { word-break: normal; }
.long-identifier { overflow-wrap: anywhere; }

Repair the exceptional string without degrading every paragraph

Suppose a report originally overflowed because of one very long machine identifier. A global word-break: break-all rule makes the page fit, but now ordinary English words split at arbitrary letters throughout the narrative. Start by removing that inherited rule from prose and isolating the original identifier in its own class. Apply emergency wrapping only there, or keep it in a locally scrollable code block if exact visual grouping is important. The width problem and the prose-reading problem should have separate, narrowly scoped treatments.

Mixed CJK and Latin content needs real examples rather than a single generic line-breaking assumption. A keep-all treatment can suppress breaks that would otherwise be available in CJK text, while break-all can produce undesirable divisions in embedded Latin words. Inspect punctuation and short parenthetical phrases as well as long runs of characters. Use language metadata correctly, but do not assume it overrides every explicit CSS breaking rule. When the document includes a language the author does not read, obtain a review from someone who can recognize unnatural or misleading divisions.

Distinguish word breaking from hyphenation and from whitespace preservation. A prose paragraph with normal spaces does not have the same requirements as a path, a code sample, or a preformatted diagnostic table. Test each representative content type after changing inherited styles. Copy an exact identifier to ensure the display treatment has not introduced literal spaces or punctuation into the value. Then read a full paragraph at enlarged text size. A successful fix retains recognizable words and language-appropriate flow while allowing exceptional long strings to remain available, rather than using the absence of a horizontal scrollbar as its only quality measure.

Verify the repaired artifact

Test a mixed passage containing punctuation, a Latin identifier, and ordinary sentences. Each kind of content should wrap in a way that preserves recognition.

Sources and further reading

AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.

All html troubleshooting guides →

Read as MarkdownAll guides

Undo aggressive word breaking in mixed-language prose · gitHtml