summaryrefslogtreecommitdiff
path: root/_exts
diff options
context:
space:
mode:
Diffstat (limited to '_exts')
-rw-r--r--_exts/typescriptdomain.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/_exts/typescriptdomain.py b/_exts/typescriptdomain.py
index 0f08fffe..83ab26c6 100644
--- a/_exts/typescriptdomain.py
+++ b/_exts/typescriptdomain.py
@@ -576,8 +576,12 @@ literal_reg = re.compile(r"``([^`]+)``")
def setup(app):
- lexer = BetterTypeScriptLexer()
- lexer.add_filter(LinkFilter(app))
- app.add_lexer("tsref", lexer)
+
+ class TsrefLexer(BetterTypeScriptLexer):
+ def __init__(self, **options):
+ super().__init__(**options)
+ self.add_filter(LinkFilter(app))
+
+ app.add_lexer("tsref", TsrefLexer)
app.add_domain(TypeScriptDomain)
app.add_builder(MyHtmlBuilder)