summaryrefslogtreecommitdiff
path: root/_exts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-07-22 20:56:11 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-07-22 20:56:11 +0530
commit48f5d798083fa18fe0a7ea40c02f7f311a68cfdf (patch)
treecf417118cc5e016bd632141b6593a15b6c09cd5a /_exts
parent2eeefb197b860ffee00ae6b1aa676e07c1677dee (diff)
downloaddocs-48f5d798083fa18fe0a7ea40c02f7f311a68cfdf.tar.gz
docs-48f5d798083fa18fe0a7ea40c02f7f311a68cfdf.tar.bz2
docs-48f5d798083fa18fe0a7ea40c02f7f311a68cfdf.zip
improve parsing of type declaration literals
Diffstat (limited to '_exts')
-rw-r--r--_exts/typescriptdomain.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/_exts/typescriptdomain.py b/_exts/typescriptdomain.py
index 44e30f7..ce21b3b 100644
--- a/_exts/typescriptdomain.py
+++ b/_exts/typescriptdomain.py
@@ -388,7 +388,9 @@ class LinkingHtmlFormatter(HtmlFormatter):
if tok_getprop(tok, "is_identifier"):
if xref.startswith('"'):
return value
- if xref in ("number", "object", "string", "boolean", "any", "true", "false", "null"):
+ if re.match("^[0-9]+$", xref) is not None:
+ return value
+ if xref in ("number", "object", "string", "boolean", "any", "true", "false", "null", "undefined", "Array"):
return value
if xref is None: