diff --git a/sphinxcontrib/confluencebuilder/builder.py b/sphinxcontrib/confluencebuilder/builder.py index 6c124475..9324676f 100644 --- a/sphinxcontrib/confluencebuilder/builder.py +++ b/sphinxcontrib/confluencebuilder/builder.py @@ -48,6 +48,7 @@ class ConfluenceBuilder(Builder): name = 'confluence' format = 'confluence_storage' supported_image_types = ConfluenceSupportedImages() + supported_linkcode = True supported_remote_images = True def __init__(self, app, env=None): diff --git a/sphinxcontrib/confluencebuilder/storage/translator.py b/sphinxcontrib/confluencebuilder/storage/translator.py index 96983a7d..dd094aba 100644 --- a/sphinxcontrib/confluencebuilder/storage/translator.py +++ b/sphinxcontrib/confluencebuilder/storage/translator.py @@ -1140,9 +1140,12 @@ def _visit_reference_extern(self, node): next_child = first(findall(node, include_self=False)) if isinstance(next_child, nodes.inline): if 'viewcode-link' in next_child.get('classes', []): - self.body.append(self._start_tag(node, 'div', - **{'style': 'float: right'})) - self._reference_context.append(self._end_tag(node)) + if self.v2: + self.body.append(' ') + else: + self.body.append(self._start_tag(node, 'div', + **{'style': 'float: right'})) + self._reference_context.append(self._end_tag(node)) if 'reftitle' in node: title = node['reftitle']