From 5c9cf3d08a616320683599f1594ee1a155f5f11d Mon Sep 17 00:00:00 2001 From: Vasista Vovveti Date: Fri, 29 Dec 2023 15:36:49 -0800 Subject: [PATCH] Fix i18n of buttons --- sphinx_design/badges_buttons.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sphinx_design/badges_buttons.py b/sphinx_design/badges_buttons.py index 8026297..1e858bf 100644 --- a/sphinx_design/badges_buttons.py +++ b/sphinx_design/badges_buttons.py @@ -178,11 +178,8 @@ def run(self) -> List[nodes.Node]: node["reftitle"] = self.options["tooltip"] # TODO escape HTML if self.content: - textnodes, _ = self.state.inline_text( - "\n".join(self.content), self.lineno + self.content_offset - ) - content = nodes.inline("", "") - content.extend(textnodes) + content = nodes.paragraph() + self.state.nested_parse(self.content, self.content_offset, content) else: content = nodes.inline(target, target) node.append(content) @@ -195,7 +192,6 @@ def run(self) -> List[nodes.Node]: # `visit_reference` requires that a reference be inside a `TextElement` parent container = nodes.paragraph(classes=self.options.get("align", [])) - self.set_source_info(container) container += node return [container]