Skip to content

Commit

Permalink
Closes: sphinx-doc#8807 by letting sphinxadmonition step a counter
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Feb 7, 2021
1 parent 86b9542 commit 5d34428
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Bugs fixed
* #8780: LaTeX: long words in narrow columns may not be hyphenated
* #8788: LaTeX: ``\titleformat`` last argument in sphinx.sty should be
bracketed, not braced (and is anyhow not needed)
* #8807: LaTeX: todo directive inserts ``\label`` without a proper anchor point
(from ``\phantomsection`` or a counter stepping)

Testing
--------
Expand Down
3 changes: 3 additions & 0 deletions sphinx/texinputs/sphinx.sty
Original file line number Diff line number Diff line change
Expand Up @@ -1686,8 +1686,11 @@
\csname\@backslashchar color@#2\endcsname }
% the main dispatch for all types of notices
% work around a problem with todo extension triggering usage of \label
% without a proper anchor set-up via ref-stepping a counter (or \phantomsection)
\newcounter{sphinxadmonition}
\newenvironment{sphinxadmonition}[2]{% #1=type, #2=heading
\refstepcounter{sphinxadmonition}% in case extension triggers \label usage
% can't use #1 directly in definition of end part
\def\spx@noticetype {#1}%
% set parameters of heavybox/lightbox
Expand Down

0 comments on commit 5d34428

Please sign in to comment.