summaryrefslogtreecommitdiff
path: root/_exts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2020-12-14 14:21:13 +0100
committerFlorian Dold <florian@dold.me>2020-12-14 14:21:13 +0100
commit23405a23bd2771cb4c1c22f942a974e836531f77 (patch)
tree644f45e7154480912f0847b366b0e9896b7c9f92 /_exts
parent51a5a7f9f82eae45a7a362118239f18bb0ce4f4e (diff)
downloaddocs-23405a23bd2771cb4c1c22f942a974e836531f77.tar.gz
docs-23405a23bd2771cb4c1c22f942a974e836531f77.tar.bz2
docs-23405a23bd2771cb4c1c22f942a974e836531f77.zip
address lexer API warning
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 0f08fff..83ab26c 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)