File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/pydata_sphinx_theme/theme/pydata_sphinx_theme Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 89
89
{% include "sections/sidebar-primary.html" %}
90
90
</ div >
91
91
{# Using an ID here so that the skip-link works #}
92
- < main id ="main-content " class ="bd-main ">
92
+ < main id ="main-content " class ="bd-main " role =" main " >
93
93
{# Main content area #}
94
94
{% block docs_main %}
95
95
< div class ="bd-content ">
Original file line number Diff line number Diff line change @@ -1164,3 +1164,12 @@ def test_render_secondary_sidebar_dict_multiple_glob_matches(
1164
1164
assert not sphinx_build .html_tree ("section1/index.html" ).select ("div.sourcelink" )
1165
1165
assert sphinx_build .html_tree ("section2/index.html" ).select ("div.sourcelink" )
1166
1166
assert sphinx_build .html_tree ("section2/page1.html" ).select ("div.sourcelink" )
1167
+
1168
+
1169
+ def test_role_main_for_search_highlights (sphinx_build_factory ):
1170
+ """Sphinx searchtools.js looks for [role="main"], so make sure it's there.
1171
+
1172
+ This is a regression test. See #1676.
1173
+ """
1174
+ sphinx_build = sphinx_build_factory ("base" ).build ()
1175
+ assert sphinx_build .html_tree ("index.html" ).select_one ('[role="main"]' )
You can’t perform that action at this time.
0 commit comments