Fix #6096: html: Anchor links are not added to figures

This commit is contained in:
Takeshi KOMIYA
2019-02-24 17:44:59 +09:00
parent 0b2210c99a
commit 524ac7ff0a
4 changed files with 13 additions and 6 deletions

View File

@@ -1254,6 +1254,15 @@ def test_html_inventory(app):
'The basic Sphinx documentation for testing')
@pytest.mark.sphinx('html', testroot='images', confoverrides={'html_sourcelink_suffix': ''})
def test_html_anchor_for_figure(app):
app.builder.build_all()
content = (app.outdir / 'index.html').text()
assert ('<p class="caption"><span class="caption-text">The caption of pic</span>'
'<a class="headerlink" href="#id1" title="Permalink to this image">¶</a></p>'
in content)
@pytest.mark.sphinx('html', testroot='directives-raw')
def test_html_raw_directive(app, status, warning):
app.builder.build_all()