From 53b088f09ac93036f30c1fa5ee56852bef918e85 Mon Sep 17 00:00:00 2001 From: Alan Du Date: Wed, 26 Feb 2020 20:24:32 -0500 Subject: [PATCH] Monkeytype pylib/anki/latex.py --- pylib/anki/latex.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pylib/anki/latex.py b/pylib/anki/latex.py index f0df41d4e..9aeac75e9 100644 --- a/pylib/anki/latex.py +++ b/pylib/anki/latex.py @@ -33,14 +33,16 @@ if isMac: os.environ["PATH"] += ":/usr/texbin:/Library/TeX/texbin" -def on_card_did_render(output: TemplateRenderOutput, ctx: TemplateRenderContext): +def on_card_did_render( + output: TemplateRenderOutput, ctx: TemplateRenderContext +) -> None: output.question_text = render_latex( output.question_text, ctx.note_type(), ctx.col() ) output.answer_text = render_latex(output.answer_text, ctx.note_type(), ctx.col()) -def render_latex(html: str, model: NoteType, col: anki.storage._Collection,) -> str: +def render_latex(html: str, model: NoteType, col: anki.storage._Collection) -> str: "Convert embedded latex tags in text to image links." html, err = render_latex_returning_errors(html, model, col) if err: @@ -49,7 +51,10 @@ def render_latex(html: str, model: NoteType, col: anki.storage._Collection,) -> def render_latex_returning_errors( - html: str, model: NoteType, col: anki.storage._Collection, expand_clozes=False + html: str, + model: NoteType, + col: anki.storage._Collection, + expand_clozes: bool = False, ) -> Tuple[str, List[str]]: """Returns (text, errors).