mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Enable pdf hyperlinks to named literal-blocks without caption.
This is tango between latex.py and sphinx.sty to handle PDF hyperlinks to literal-blocks (both code-block and literalinclude) either with name or caption (then numref can be used) or both. modified: sphinx/texinputs/sphinx.sty modified: sphinx/writers/latex.py This test file is now back to original. modified: tests/test_directive_code.py
This commit is contained in:
@@ -64,7 +64,7 @@ def test_code_block_caption_html(app, status, warning):
|
||||
def test_code_block_caption_latex(app, status, warning):
|
||||
app.builder.build_all()
|
||||
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
|
||||
caption = '\\SphinxSetupCaptionForVerbatim{literal-block}{\label{caption:caption-test-rb}caption \\emph{test} rb}'
|
||||
caption = '\\SphinxSetupCaptionForVerbatim{literal-block}{caption \\emph{test} rb}'
|
||||
assert caption in latex
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ def test_literalinclude_caption_html(app, status, warning):
|
||||
def test_literalinclude_caption_latex(app, status, warning):
|
||||
app.builder.build('index')
|
||||
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
|
||||
caption = '\\SphinxSetupCaptionForVerbatim{literal-block}{\label{caption:caption-test-py}caption \\textbf{test} py}'
|
||||
caption = '\\SphinxSetupCaptionForVerbatim{literal-block}{caption \\textbf{test} py}'
|
||||
assert caption in latex
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user