Skip to content

Commit

Permalink
Merge pull request #1073 from sphinx-contrib/avoid-inlined-imgs-for-v…
Browse files Browse the repository at this point in the history
…2-editor

disable use of inline images in v2 editor
  • Loading branch information
jdknight authored Jan 18, 2025
2 parents b480a2b + f9775cb commit ac65dcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sphinxcontrib/confluencebuilder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ def setup(app):
cm.add_conf_bool('confluence_adv_embedded_certs')
# List of node types to ignore if no translator support exists.
cm.add_conf('confluence_adv_ignore_nodes')
# Add the inline attribute for images (v2 editor)
cm.add_conf_bool('confluence_adv_inlined_images')
# Unknown node handler dictionary for advanced integrations.
cm.add_conf('confluence_adv_node_handler')
# Permit any string value to be provided as the editor.
Expand Down
6 changes: 5 additions & 1 deletion sphinxcontrib/confluencebuilder/storage/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,11 @@ def _visit_image(self, node, opts):
if alignment == 'right':
attribs['ac:style'] = 'float: right;'
elif self.v2:
attribs['ac:inline'] = 'true'
# ideally, images will be inlined but recent v2 editor will
# restrict sizing to the line; restrict the feature using a
# configuration option for now
if self.builder.config.confluence_adv_inlined_images:
attribs['ac:inline'] = 'true'

if 'alt' in node:
alt = node['alt']
Expand Down

0 comments on commit ac65dcb

Please sign in to comment.