summaryrefslogtreecommitdiff
path: root/_exts
diff options
context:
space:
mode:
Diffstat (limited to '_exts')
-rw-r--r--_exts/typescriptdomain.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/_exts/typescriptdomain.py b/_exts/typescriptdomain.py
index 68777645..f9af1b01 100644
--- a/_exts/typescriptdomain.py
+++ b/_exts/typescriptdomain.py
@@ -405,6 +405,8 @@ class LinkingHtmlFormatter(HtmlFormatter):
):
return value
+ if self._bridge.docname is None:
+ return value
if xref is None:
return value
content = caption if caption is not None else value
@@ -509,10 +511,11 @@ class MyPygmentsBridge(PygmentsBridge):
def highlight_block(
self, source, lang, opts=None, force=False, location=None, **kwargs
):
- docname, line = location
- self.line = line
- self.path = self.builder.env.doc2path(docname)
- self.docname = docname
+ if isinstance(location, tuple):
+ docname, line = location
+ self.line = line
+ self.path = self.builder.env.doc2path(docname)
+ self.docname = docname
return super().highlight_block(source, lang, opts, force, location, **kwargs)