commit 23405a23bd2771cb4c1c22f942a974e836531f77 parent 51a5a7f9f82eae45a7a362118239f18bb0ce4f4e Author: Florian Dold <florian@dold.me> Date: Mon, 14 Dec 2020 14:21:13 +0100 address lexer API warning Diffstat:
| M | _exts/typescriptdomain.py | | | 10 | +++++++--- |
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git 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)