From 8e2b686ec221f9dc01feb1c19147c1e8fb648d67 Mon Sep 17 00:00:00 2001 From: Jeff Dairiki Date: Sun, 26 Feb 2023 15:08:39 -0800 Subject: [PATCH] fix(markdown-link-classes): fix for mistune 2 Mistune 2 does not always pass a `text` or `title` parameter to the renderer's `link` method. This (when building with the Lektor 3.4 pre-release branch) was resulting in a `"TypeError: link() missing 2 required positional arguments: 'text' and 'title'"` exception when rendering /blog/plugin-play (which has a bare URL in it's markdown content.) --- packages/markdown-link-classes/lektor_markdown_link_classes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/markdown-link-classes/lektor_markdown_link_classes.py b/packages/markdown-link-classes/lektor_markdown_link_classes.py index 1fe0f8dc..d3f17e63 100644 --- a/packages/markdown-link-classes/lektor_markdown_link_classes.py +++ b/packages/markdown-link-classes/lektor_markdown_link_classes.py @@ -34,7 +34,7 @@ if mistune_version.startswith("0."): return render_link(link, text, title) else: class LinkClassesMixin(object): - def link(renderer, link, text, title): + def link(renderer, link, text="", title=None): return render_link(link, text, title)