summaryrefslogtreecommitdiff
path: root/sphinx/domains/std.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/domains/std.py')
-rw-r--r--sphinx/domains/std.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py
index 7660f84c9..d08c65668 100644
--- a/sphinx/domains/std.py
+++ b/sphinx/domains/std.py
@@ -770,10 +770,11 @@ class StandardDomain(Domain):
sectname = clean_astext(title)
elif node.tagname == 'rubric':
sectname = clean_astext(node)
+ elif node.tagname == 'target' and len(node) > 0:
+ # inline target (ex: blah _`blah` blah)
+ sectname = clean_astext(node)
elif self.is_enumerable_node(node):
sectname = self.get_numfig_title(node)
- if not sectname:
- continue
else:
toctree = next(iter(node.traverse(addnodes.toctree)), None)
if toctree and toctree.get('caption'):
@@ -781,7 +782,8 @@ class StandardDomain(Domain):
else:
# anonymous-only labels
continue
- self.labels[name] = docname, labelid, sectname
+ if sectname:
+ self.labels[name] = docname, labelid, sectname
def add_program_option(self, program: str, name: str, docname: str, labelid: str) -> None:
self.progoptions[program, name] = (docname, labelid)