Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle toctree caption changing from nodes.caption to nodes.title #458

Merged
merged 1 commit into from
Apr 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sphinxcontrib/confluencebuilder/translator/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from __future__ import unicode_literals
from docutils import nodes
from os import path
from sphinx import addnodes
from sphinx.locale import _
from sphinx.locale import admonitionlabels
from sphinx.util.images import get_image_size
Expand Down Expand Up @@ -170,7 +171,9 @@ def visit_title(self, node):
self.context.append(self._end_ac_link(node))
self.body.append(self._start_ac_link_body(node))
self.context.append(self._end_ac_link_body(node))

elif (isinstance(node.parent, addnodes.compact_paragraph) and
node.parent.get('toctree')):
self.visit_caption(node)
else:
# Only render section/topic titles in headers. For all other nodes,
# they must explicitly manage their own title entries.
Expand All @@ -184,6 +187,9 @@ def depart_title(self, node):
self.body.append(self.context.pop()) # end_ac_link

self.body.append(self.context.pop()) # h<x>
elif (isinstance(node.parent, addnodes.compact_paragraph) and
node.parent.get('toctree')):
self.depart_caption(node)

def visit_paragraph(self, node):
self.body.append(self._start_tag(node, 'p'))
Expand Down