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.)
This commit is contained in:
Jeff Dairiki 2023-02-26 15:08:39 -08:00
parent 0fc4911486
commit 8e2b686ec2
1 changed files with 1 additions and 1 deletions

View File

@ -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)