mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix broken handling of whitespace in GenericObject.
This actually makes the code matches its comment, i.e, whitespaces are now normalized the same way XRefRole does. Without the fix, when creating a directive/role via add_object_type, the following testcase fails with "WARNING: 'baz' reference target not found: foo bar". :baz:`foo bar` .. baz:: foo bar The current workaround is to explicitly mention the broken target, e.g., :baz:`foo bar <foobar>` .. baz:: foo bar
This commit is contained in:
parent
ee0656f51f
commit
cea18198ce
@ -62,7 +62,7 @@ class GenericObject(ObjectDescription):
|
||||
signode.clear()
|
||||
signode += addnodes.desc_name(sig, sig)
|
||||
# normalize whitespace like XRefRole does
|
||||
name = ws_re.sub('', sig)
|
||||
name = ws_re.sub(' ', sig)
|
||||
return name
|
||||
|
||||
def add_target_and_index(self, name: str, sig: str, signode: desc_signature) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user