diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-10-17 16:06:45 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-10-17 16:08:37 +0900 |
commit | 53ea1cb2808e90b51f0ed9468740a34c00decc2a (patch) | |
tree | e442ad075ba6ba89ced0ce6e4ee7abc7e9cf4277 /tests | |
parent | 78d96b4abb1ac98efb96e73b79f70375f3496194 (diff) | |
download | sphinx-git-53ea1cb2808e90b51f0ed9468740a34c00decc2a.tar.gz |
Fix #3045: HTML search index creator should ignore "raw" content if now html
Diffstat (limited to 'tests')
-rw-r--r-- | tests/roots/test-search/index.rst | 10 | ||||
-rw-r--r-- | tests/test_search.py | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/tests/roots/test-search/index.rst b/tests/roots/test-search/index.rst index 21fcdf53c..b593c6cad 100644 --- a/tests/roots/test-search/index.rst +++ b/tests/roots/test-search/index.rst @@ -17,4 +17,12 @@ textinheading .. toctree:: - tocitem
\ No newline at end of file + tocitem + +.. raw:: html + + <span class="raw">rawword"</span> + +.. raw:: latex + + latex_keyword diff --git a/tests/test_search.py b/tests/test_search.py index a363b30be..d4b8817de 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -114,4 +114,12 @@ def test_term_in_heading_and_section(app, status, warning): # both documents should be a hit in the search index as a title, # respectively text hit assert 'textinhead:1' in searchindex - assert 'textinhead:0' in searchindex
\ No newline at end of file + assert 'textinhead:0' in searchindex + + +@with_app(testroot='search') +def test_term_in_raw_directive(app, status, warning): + searchindex = jsload(app.outdir / 'searchindex.js') + assert not is_registered_term(searchindex, 'raw') + assert is_registered_term(searchindex, 'rawword') + assert not is_registered_term(searchindex, 'latex_keyword') |