Skip to content

Commit

Permalink
disable use of inline images in v2 editor
Browse files Browse the repository at this point in the history
Recent changes to Confluence's v2 editor restricted inlined images to
a line-height. This is undesired for a default configuration. To avoid
this, v2 images will no longer be configured with an inline hint.

Signed-off-by: James Knight <[email protected]>
  • Loading branch information
jdknight committed Jan 18, 2025
1 parent b480a2b commit f9775cb
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 f9775cb

Please sign in to comment.