diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-24 14:30:06 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-24 14:30:06 +0900 |
commit | becf8f43befe8a1528552106848c0e369b7fba9a (patch) | |
tree | 074b47ff20bed49a03ac1ffe6dec42b830e9da9b /tests/test_build_html.py | |
parent | 3a0a6556c59a7b31586dd97b43101f8dbfd2ef63 (diff) | |
parent | 15cbc6dbb0b07aaa43ed95fa7fcc7bb8fe107a4e (diff) | |
download | sphinx-git-becf8f43befe8a1528552106848c0e369b7fba9a.tar.gz |
Merge pull request #8599 from tk0miya/6550_html_permalinks_icon
Close #6550: html: Allow to use HTML permalink texts
Diffstat (limited to 'tests/test_build_html.py')
-rw-r--r-- | tests/test_build_html.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_build_html.py b/tests/test_build_html.py index d7b572abd..9abfa19aa 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -1665,3 +1665,23 @@ def test_highlight_options_old(app): location=ANY, opts={}) assert call_args[2] == call(ANY, 'java', force=False, linenos=False, location=ANY, opts={}) + + +@pytest.mark.sphinx('html', testroot='basic', + confoverrides={'html_permalinks': False}) +def test_html_permalink_disable(app): + app.build() + content = (app.outdir / 'index.html').read_text() + + assert '<h1>The basic Sphinx documentation for testing</h1>' in content + + +@pytest.mark.sphinx('html', testroot='basic', + confoverrides={'html_permalinks_icon': '<span>[PERMALINK]</span>'}) +def test_html_permalink_icon(app): + app.build() + content = (app.outdir / 'index.html').read_text() + + assert ('<h1>The basic Sphinx documentation for testing<a class="headerlink" ' + 'href="#the-basic-sphinx-documentation-for-testing" ' + 'title="Permalink to this headline"><span>[PERMALINK]</span></a></h1>' in content) |