summaryrefslogtreecommitdiff
path: root/sphinx/domains/javascript.py
diff options
context:
space:
mode:
authorJakob Lykke Andersen <Jakob@caput.dk>2021-10-02 13:43:25 +0200
committerJakob Lykke Andersen <Jakob@caput.dk>2021-10-03 10:17:31 +0200
commit1c124e025866c61e20c7f0dceb13e772ff645e74 (patch)
tree499b8b5c0cb4dc7e7edcdcd7ba84b4ddf98eab75 /sphinx/domains/javascript.py
parent37083fcc1ab12fbc6d53213a92a132191eb79fc1 (diff)
downloadsphinx-git-1c124e025866c61e20c7f0dceb13e772ff645e74.tar.gz
js nodes, update prefix rendering
Diffstat (limited to 'sphinx/domains/javascript.py')
-rw-r--r--sphinx/domains/javascript.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/sphinx/domains/javascript.py b/sphinx/domains/javascript.py
index 7abfad482..450c9c761 100644
--- a/sphinx/domains/javascript.py
+++ b/sphinx/domains/javascript.py
@@ -72,6 +72,7 @@ class JSObject(ObjectDescription[Tuple[str, str]]):
# If construct is nested, prefix the current prefix
prefix = self.env.ref_context.get('js:object', None)
mod_name = self.env.ref_context.get('js:module')
+
name = member
try:
member_prefix, member_name = member.rsplit('.', 1)
@@ -95,10 +96,18 @@ class JSObject(ObjectDescription[Tuple[str, str]]):
display_prefix = self.get_display_prefix()
if display_prefix:
signode += addnodes.desc_annotation('', '', *display_prefix)
+
+ actualPrefix = None
if prefix:
- signode += addnodes.desc_addname(prefix + '.', prefix + '.')
+ actualPrefix = prefix
elif mod_name:
- signode += addnodes.desc_addname(mod_name + '.', mod_name + '.')
+ actualPrefix = mod_name
+ if actualPrefix:
+ addName = addnodes.desc_addname('', '')
+ for p in actualPrefix.split('.'):
+ addName += addnodes.desc_sig_name(p, p)
+ addName += addnodes.desc_sig_punctuation('.', '.')
+ signode += addName
signode += addnodes.desc_name(name, name)
if self.has_arguments:
if not arglist: