From 6a4b8d91994b611761c84072383833a7ef020819 Mon Sep 17 00:00:00 2001 From: gridtime Date: Mon, 4 Mar 2024 11:16:56 +0100 Subject: [PATCH] fixes mistune version condition --- src/backend/html_markdown.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/html_markdown.py b/src/backend/html_markdown.py index 711f7bd5..6a8aac99 100644 --- a/src/backend/html_markdown.py +++ b/src/backend/html_markdown.py @@ -41,10 +41,10 @@ def plugin_matrix(md): # Mark colour as high priority as otherwise e.g. (hi) matches the # inline_html rule instead of the colour rule. md.inline.rules.insert(1, "colour") - if mistune.__version__.startswith("3"): - md.inline.register("colour", colour, parse_colour) + if mistune.__version__.startswith("2."): # v2 + md.inline.register_rule("colour", colour, parse_colour) else: - md.inline.register_rule("colour", colour, parse_colour) # v2 + md.inline.register("colour", colour, parse_colour) if md.renderer.NAME == "html": md.renderer.register("colour", render_html_colour)