summaryrefslogtreecommitdiff
path: root/Documentation/sphinx/kernel_abi.py
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2025-02-10 11:18:06 +0100
committerJonathan Corbet <corbet@lwn.net>2025-02-10 11:19:57 -0700
commitcc93e4829a14339575383fb3cd7d3e858faabc2a (patch)
tree2768d944112807d5bb8d2ac3c722ab453ef00ec7 /Documentation/sphinx/kernel_abi.py
parentaea5e52dce74f679b91c66caad91d587d5504f6c (diff)
docs: sphinx/kernel_abi: properly split lines
Sphinx doesn't like to have lines split with str.split("\n"). Instead, it uses its own splitter, with handles line breaks the way Spinx expects. Not using it cause issues at the output files. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/d4ad5b977799616544376210364d5cec686119ef.1739182025.git.mchehab+huawei@kernel.org
Diffstat (limited to 'Documentation/sphinx/kernel_abi.py')
-rw-r--r--Documentation/sphinx/kernel_abi.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Documentation/sphinx/kernel_abi.py b/Documentation/sphinx/kernel_abi.py
index 742ebd35454f..0a4057183208 100644
--- a/Documentation/sphinx/kernel_abi.py
+++ b/Documentation/sphinx/kernel_abi.py
@@ -36,7 +36,7 @@ import os
import re
import sys
-from docutils import nodes
+from docutils import nodes, statemachine
from docutils.statemachine import ViewList
from docutils.parsers.rst import directives, Directive
from sphinx.util.docutils import switch_source_input
@@ -105,7 +105,8 @@ class KernelCmd(Directive):
old_f = fname
n = 0
for msg, f, ln in self.parser.doc():
- msg_list = msg.split("\n")
+ msg_list = statemachine.string2lines(msg, tab_width,
+ convert_whitespace=True)
if "debug" in self.options:
lines = [
"", "", ".. code-block:: rst",