From: Rito Rhymes Date: Mon, 23 Mar 2026 15:14:01 +0000 (-0400) Subject: docs: allow inline literals in paragraphs to wrap to prevent overflow X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2679ac773899f5fdea0b68d5077eef5f88dfd42;p=thirdparty%2Flinux.git docs: allow inline literals in paragraphs to wrap to prevent overflow Some documentation pages contain long inline literals in paragraph text that can force page-wide horizontal scroll overflow and break layout on smaller screens. Override the default `span.pre` white-space behavior for inline literals and use `overflow-wrap: anywhere` so they can wrap when needed. For code used as part of a paragraph, wrapping is appropriate because it is stylistically part of the surrounding text. Code blocks, by contrast, are meant to preserve formatting fidelity and are better served by contained horizontal scrolling. Examples: https://docs.kernel.org/6.15/userspace-api/futex2.html https://docs.kernel.org/6.15/security/IMA-templates.html Signed-off-by: Rito Rhymes Assisted-by: Codex:GPT-5.4 Tested-by: Randy Dunlap Signed-off-by: Jonathan Corbet Message-ID: <20260323151401.27415-1-rito@ritovision.com> --- diff --git a/Documentation/sphinx-static/custom.css b/Documentation/sphinx-static/custom.css index db24f4344e6cf..dd69df2a7f57a 100644 --- a/Documentation/sphinx-static/custom.css +++ b/Documentation/sphinx-static/custom.css @@ -149,6 +149,15 @@ div.language-selection ul li:hover { background: #dddddd; } +/* + * Let long inline literals in paragraph text wrap as needed to prevent + * overflow. + */ +code.docutils.literal span.pre { + white-space: normal; + overflow-wrap: anywhere; +} + /* Make xrefs more universally visible */ a.reference, a.reference:hover { border-bottom: none;