Skip to content

Commit

Permalink
Update CHANGES
Browse files Browse the repository at this point in the history
  • Loading branch information
picnixz committed Apr 17, 2023
1 parent 6157651 commit 02cc662
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ Features added
Bugs fixed
----------

* #11093: LaTeX: fix build warnings when one or more reST labels directly preceed an
:rst:dir:`py:module` or :rst:dir:`automodule` directive. Patch by Bénédikt Tran (picnixz)
* #11079: LaTeX: figures with align attribute may disappear and strangely impact
following lists
* #11110: LaTeX: Figures go missing from latex pdf if their files have the same
Expand Down
6 changes: 3 additions & 3 deletions sphinx/writers/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -1504,14 +1504,14 @@ def add_target(id: str) -> None:
if node.get('ismod', False):
# Detect if the previous nodes are label targets. If so, remove
# the refid thereof from node['ids'] to avoid duplicated ids.
def has_dup_label(sib: Element | None) -> bool:
def has_dup_label(sib: Node | None) -> bool:
return isinstance(sib, nodes.target) and sib.get('refid') in node['ids']

prev: Element | None = get_prev_node(node)
prev = get_prev_node(node)
if has_dup_label(prev):
ids = node['ids'][:] # copy to avoid side-effects
while has_dup_label(prev):
ids.remove(prev['refid'])
ids.remove(prev['refid']) # type: ignore
prev = get_prev_node(prev)
else:
ids = iter(node['ids']) # read-only iterator
Expand Down

0 comments on commit 02cc662

Please sign in to comment.