From 355d2bb36fce7c120845486a93f81dc8a4029dd9 Mon Sep 17 00:00:00 2001 From: James Knight Date: Fri, 16 Aug 2024 21:55:25 -0400 Subject: [PATCH] transmute: support sphinx-toolbox collapse node label change An update [1] has been made to sphinx-toolbox's CollapseNode. Adjusting the transmute logic to support the variant label approaches. [1]: https://github.com/sphinx-toolbox/sphinx-toolbox/commit/ae0ae836268a8e77e36ce58e534131e9ac42a75d Signed-off-by: James Knight --- .../confluencebuilder/transmute/ext_sphinx_toolbox.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sphinxcontrib/confluencebuilder/transmute/ext_sphinx_toolbox.py b/sphinxcontrib/confluencebuilder/transmute/ext_sphinx_toolbox.py index 9683163a..b883fee1 100644 --- a/sphinxcontrib/confluencebuilder/transmute/ext_sphinx_toolbox.py +++ b/sphinxcontrib/confluencebuilder/transmute/ext_sphinx_toolbox.py @@ -82,7 +82,13 @@ def replace_sphinx_toolbox_nodes(builder, doctree): for node in findall(doctree, sphinx_toolbox_CollapseNode): new_node = confluence_expand(node.rawsource, *node.children, **node.attributes) - new_node.attributes['title'] = node.label + + if hasattr(node, 'label'): + new_label = node.label + else: + new_label = node.get('label', '') + + new_node.attributes['title'] = new_label node.replace_self(new_node) if has_sphinx_toolbox_github_issues: