From 3f3e1c4095ae229b0c6d0364f289a20732281a96 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Wed, 26 Feb 2025 20:10:55 +0000 Subject: Doc: Strip trailing whitespace in ``pydoc_topics`` (#130492) --- Doc/tools/extensions/pydoc_topics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/tools/extensions/pydoc_topics.py b/Doc/tools/extensions/pydoc_topics.py index 6e43df2..0f3dfac 100644 --- a/Doc/tools/extensions/pydoc_topics.py +++ b/Doc/tools/extensions/pydoc_topics.py @@ -143,7 +143,8 @@ class PydocTopicsBuilder(TextBuilder): document.append(doc_ids[label_id]) visitor = TextTranslator(document, builder=self) document.walkabout(visitor) - self.topics[topic_label] = visitor.body + body = "\n".join(map(str.rstrip, visitor.body.splitlines())) + self.topics[topic_label] = body def finish(self) -> None: topics_repr = "\n".join( -- cgit v0.12