From 23405a23bd2771cb4c1c22f942a974e836531f77 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 14 Dec 2020 14:21:13 +0100 Subject: address lexer API warning --- _exts/typescriptdomain.py | 10 +++++++--- 1 file 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) -- cgit v1.2.3