Skip to content

Commit ac65dcb

Browse files
authored
Merge pull request #1073 from sphinx-contrib/avoid-inlined-imgs-for-v2-editor
disable use of inline images in v2 editor
2 parents b480a2b + f9775cb commit ac65dcb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

sphinxcontrib/confluencebuilder/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ def setup(app):
266266
cm.add_conf_bool('confluence_adv_embedded_certs')
267267
# List of node types to ignore if no translator support exists.
268268
cm.add_conf('confluence_adv_ignore_nodes')
269+
# Add the inline attribute for images (v2 editor)
270+
cm.add_conf_bool('confluence_adv_inlined_images')
269271
# Unknown node handler dictionary for advanced integrations.
270272
cm.add_conf('confluence_adv_node_handler')
271273
# Permit any string value to be provided as the editor.

sphinxcontrib/confluencebuilder/storage/translator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,11 @@ def _visit_image(self, node, opts):
18551855
if alignment == 'right':
18561856
attribs['ac:style'] = 'float: right;'
18571857
elif self.v2:
1858-
attribs['ac:inline'] = 'true'
1858+
# ideally, images will be inlined but recent v2 editor will
1859+
# restrict sizing to the line; restrict the feature using a
1860+
# configuration option for now
1861+
if self.builder.config.confluence_adv_inlined_images:
1862+
attribs['ac:inline'] = 'true'
18591863

18601864
if 'alt' in node:
18611865
alt = node['alt']

0 commit comments

Comments
 (0)