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:
parent
0fc4911486
commit
8e2b686ec2
|
@ -34,7 +34,7 @@ if mistune_version.startswith("0."):
|
||||||
return render_link(link, text, title)
|
return render_link(link, text, title)
|
||||||
else:
|
else:
|
||||||
class LinkClassesMixin(object):
|
class LinkClassesMixin(object):
|
||||||
def link(renderer, link, text, title):
|
def link(renderer, link, text="", title=None):
|
||||||
return render_link(link, text, title)
|
return render_link(link, text, title)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue