Skip to content

Commit

Permalink
Merge pull request #1066 from sphinx-contrib/correct-forced-standalon…
Browse files Browse the repository at this point in the history
…e-assets-with-matching-dynamic-images

assets: ensure forced-standalone handles new-and-matches images
  • Loading branch information
jdknight authored Dec 5, 2024
2 parents de46e60 + c096d0e commit e6f05c4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions sphinxcontrib/confluencebuilder/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,16 @@ def fetch(self, node, docname=None):
if self.force_standalone:
docname = canon_path(
self.env.path2doc(node.document['source']))
assert docname in asset.docnames

# check if the expected document name is found in the
# asset's document list; if not and standalone, this
# if just an indication that this is a new/dynamic
# image entry on a document that already exists in
# another document -- for now, indicate the key does
# not exist so that the translator can process the
# image node as something new
if docname not in asset.docnames:
key = None
else:
if len(asset.docnames) > 1:
docname = self.root_doc
Expand Down Expand Up @@ -307,7 +316,7 @@ def _handle_entry(self, path, docname, standalone=False):
# duplicate asset detected; build an asset alias
asset = self.hash2asset[hash_]
self.path2asset[path] = asset
else:
elif not standalone:
assert (self.hash2asset[asset.hash] == asset)

# track (if not already) that this document uses this asset
Expand Down

0 comments on commit e6f05c4

Please sign in to comment.