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-01-11 16:34:05 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-11 16:50:45 +0300
commit12ec8f0caea1e12d39d1bd27c7fa3eba5d284bc1 (patch)
tree9163bd959369a6b4fc1baa6dc24e0c31fe88a14d /sphinx/domains
parent98993b40c5451a6db84b4c1e8549c03a9ee24677 (diff)
Fix #8651: cross-reference for a rubric having inline item is broken
The implementation of the standard domain so far has considered the first child of the rubric node is the title of the rubric. But it can may multiple nodes when the rubric title is marked up. This extracts the title of the rubric from the whole of the children of it.
Diffstat (limited to 'sphinx/domains')
-rw-r--r--sphinx/domains/std.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py
index 33acdb3f5..b936a8d19 100644
--- a/sphinx/domains/std.py
+++ b/sphinx/domains/std.py
@@ -745,9 +745,11 @@ class StandardDomain(Domain):
name, env.doc2path(self.labels[name][0]),
location=node)
self.anonlabels[name] = docname, labelid
- if node.tagname in ('section', 'rubric'):
+ if node.tagname == 'section':
title = cast(nodes.title, node[0])
sectname = clean_astext(title)
+ elif node.tagname == 'rubric':
+ sectname = clean_astext(node)
elif self.is_enumerable_node(node):
sectname = self.get_numfig_title(node)
if not sectname: