File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 12
12
from subprocess import CalledProcessError
13
13
from typing import TYPE_CHECKING
14
14
15
+ import docutils
15
16
import pygments
16
17
import pytest
17
18
@@ -1959,10 +1960,16 @@ def test_latex_labels(app: SphinxTestApp) -> None:
1959
1960
1960
1961
result = (app .outdir / 'projectnamenotset.tex' ).read_text (encoding = 'utf8' )
1961
1962
1963
+ # ref: docutils r10151
1964
+ if docutils .__version_info__ [:2 ] < (0 , 22 ):
1965
+ figure_id , table_id = 'id1' , 'id2'
1966
+ else :
1967
+ figure_id , table_id = 'id2' , 'id3'
1968
+
1962
1969
# figures
1963
1970
assert (
1964
1971
r'\caption{labeled figure}'
1965
- r'\label{\detokenize{index:id1 }}'
1972
+ r'\label{\detokenize{index:' + figure_id + ' }}'
1966
1973
r'\label{\detokenize{index:figure2}}'
1967
1974
r'\label{\detokenize{index:figure1}}'
1968
1975
r'\end{figure}'
@@ -1988,7 +1995,7 @@ def test_latex_labels(app: SphinxTestApp) -> None:
1988
1995
# tables
1989
1996
assert (
1990
1997
r'\sphinxcaption{table caption}'
1991
- r'\label{\detokenize{index:id2 }}'
1998
+ r'\label{\detokenize{index:' + table_id + ' }}'
1992
1999
r'\label{\detokenize{index:table2}}'
1993
2000
r'\label{\detokenize{index:table1}}'
1994
2001
) in result
You can’t perform that action at this time.
0 commit comments