summaryrefslogtreecommitdiff
path: root/_exts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2020-12-14 14:13:14 +0100
committerFlorian Dold <florian@dold.me>2020-12-14 14:13:14 +0100
commit51a5a7f9f82eae45a7a362118239f18bb0ce4f4e (patch)
treed89035ce8f8820defa03695d39ea18c9f5f4210a /_exts
parent1c03dae120dc47a3652b7d18a7d51511d2bf383e (diff)
downloaddocs-51a5a7f9f82eae45a7a362118239f18bb0ce4f4e.tar.gz
docs-51a5a7f9f82eae45a7a362118239f18bb0ce4f4e.tar.bz2
docs-51a5a7f9f82eae45a7a362118239f18bb0ce4f4e.zip
re-enable highlightling for newer Sphinx
Diffstat (limited to '_exts')
-rw-r--r--_exts/typescriptdomain.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/_exts/typescriptdomain.py b/_exts/typescriptdomain.py
index f9af1b0..0f08fff 100644
--- a/_exts/typescriptdomain.py
+++ b/_exts/typescriptdomain.py
@@ -8,6 +8,8 @@ TypeScript domain.
import re
+from pathlib import Path
+
from docutils import nodes
from typing import List, Optional, Iterable, Dict, Tuple
from typing import cast
@@ -516,6 +518,10 @@ class MyPygmentsBridge(PygmentsBridge):
self.line = line
self.path = self.builder.env.doc2path(docname)
self.docname = docname
+ elif isinstance(location, Element):
+ self.line = location.line
+ self.path = location.source
+ self.docname = Path(location.source).stem
return super().highlight_block(source, lang, opts, force, location, **kwargs)