{# Main content area #} {% block docs_main %}
diff --git a/tests/test_build.py b/tests/test_build.py index 1a2a623aa..60c95e308 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -1164,3 +1164,12 @@ def test_render_secondary_sidebar_dict_multiple_glob_matches( assert not sphinx_build.html_tree("section1/index.html").select("div.sourcelink") assert sphinx_build.html_tree("section2/index.html").select("div.sourcelink") assert sphinx_build.html_tree("section2/page1.html").select("div.sourcelink") + + +def test_role_main_for_search_highlights(sphinx_build_factory): + """Sphinx searchtools.js looks for [role="main"], so make sure it's there. + + This is a regression test. See #1676. + """ + sphinx_build = sphinx_build_factory("base").build() + assert sphinx_build.html_tree("index.html").select_one('[role="main"]')