fixes mistune version condition
This commit is contained in:
parent
473205007f
commit
6a4b8d9199
|
@ -41,10 +41,10 @@ def plugin_matrix(md):
|
||||||
# Mark colour as high priority as otherwise e.g. <red>(hi) matches the
|
# Mark colour as high priority as otherwise e.g. <red>(hi) matches the
|
||||||
# inline_html rule instead of the colour rule.
|
# inline_html rule instead of the colour rule.
|
||||||
md.inline.rules.insert(1, "colour")
|
md.inline.rules.insert(1, "colour")
|
||||||
if mistune.__version__.startswith("3"):
|
if mistune.__version__.startswith("2."): # v2
|
||||||
md.inline.register("colour", colour, parse_colour)
|
md.inline.register_rule("colour", colour, parse_colour)
|
||||||
else:
|
else:
|
||||||
md.inline.register_rule("colour", colour, parse_colour) # v2
|
md.inline.register("colour", colour, parse_colour)
|
||||||
|
|
||||||
if md.renderer.NAME == "html":
|
if md.renderer.NAME == "html":
|
||||||
md.renderer.register("colour", render_html_colour)
|
md.renderer.register("colour", render_html_colour)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user