Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-07-06 19:58:18 +0300
committerGitHub <noreply@github.com>2021-07-06 19:58:18 +0300
commit7bd4603d858862f66f55b6f7e398bbc8a8f464b2 (patch)
treecaab23419237fcfcbb61adaa6816162090bb64ab /sphinx/writers
parent5ce5f40402faeb55b8e001dccd6904d956f307ae (diff)
parente6ae41ed52bb6c9d4f4b81dbe3417d532994f905 (diff)
Merge pull request #9358 from jonels-msft/menu-headings
Provide more semantic structure for screen-readers
Diffstat (limited to 'sphinx/writers')
-rw-r--r--sphinx/writers/html.py2
-rw-r--r--sphinx/writers/html5.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py
index d633f07e8..e9a31a848 100644
--- a/sphinx/writers/html.py
+++ b/sphinx/writers/html.py
@@ -415,7 +415,7 @@ class HTMLTranslator(SphinxTranslator, BaseTranslator):
# overwritten
def visit_title(self, node: Element) -> None:
if isinstance(node.parent, addnodes.compact_paragraph) and node.parent.get('toctree'):
- self.body.append(self.starttag(node, 'p', '', CLASS='caption'))
+ self.body.append(self.starttag(node, 'p', '', CLASS='caption', ROLE='heading'))
self.body.append('<span class="caption-text">')
self.context.append('</span></p>\n')
else:
diff --git a/sphinx/writers/html5.py b/sphinx/writers/html5.py
index 469642591..5b38b3be2 100644
--- a/sphinx/writers/html5.py
+++ b/sphinx/writers/html5.py
@@ -366,7 +366,7 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
# overwritten
def visit_title(self, node: Element) -> None:
if isinstance(node.parent, addnodes.compact_paragraph) and node.parent.get('toctree'):
- self.body.append(self.starttag(node, 'p', '', CLASS='caption'))
+ self.body.append(self.starttag(node, 'p', '', CLASS='caption', ROLE='heading'))
self.body.append('<span class="caption-text">')
self.context.append('</span></p>\n')
else: