mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #10178 from stephenfin/issue-10177
Revert "Close #9993: std domain: Allow to refer an inline target via ref role"
This commit is contained in:
commit
4a496bfc98
@ -754,11 +754,10 @@ 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(node.findall(addnodes.toctree), None)
|
||||
if toctree and toctree.get('caption'):
|
||||
@ -766,8 +765,7 @@ class StandardDomain(Domain):
|
||||
else:
|
||||
# anonymous-only labels
|
||||
continue
|
||||
if sectname:
|
||||
self.labels[name] = docname, labelid, 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)
|
||||
|
@ -445,12 +445,3 @@ def test_labeled_rubric(app):
|
||||
domain = app.env.get_domain("std")
|
||||
assert 'label' in domain.labels
|
||||
assert domain.labels['label'] == ('index', 'label', 'blah blah blah')
|
||||
|
||||
|
||||
def test_inline_target(app):
|
||||
text = "blah _`inline target` blah\n"
|
||||
restructuredtext.parse(app, text)
|
||||
|
||||
domain = app.env.get_domain("std")
|
||||
assert 'inline target' in domain.labels
|
||||
assert domain.labels['inline target'] == ('index', 'inline-target', 'inline target')
|
||||
|
Loading…
Reference in New Issue
Block a user