diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000000000000000000000000000000000000..00b7924a11473164ee57a6601a709adf9351f960 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,13 @@ +# Change logs + +## v1.1 + +Release date 26th of January, 2019 + + - Support Markdown v2.x and v3.x + +## v1.0 + +Release date 21th of November, 2018 + + - Initial Release diff --git a/lektor_pythonmarkdown.py b/lektor_pythonmarkdown.py index 3e6450095875129c2a2e216d7355f5ecb9711ecc..8acf8704dacb1f0ba85703feaa7d9e1cd9269360 100644 --- a/lektor_pythonmarkdown.py +++ b/lektor_pythonmarkdown.py @@ -6,7 +6,10 @@ Created on Jun 8, 2018 ''' import markdown from markdown.extensions import Extension -from markdown.inlinepatterns import LinkPattern + +# Markdown v3.x +from markdown.inlinepatterns import Pattern + from markupsafe import Markup import types from weakref import ref as weakref @@ -33,7 +36,7 @@ def sanitize_link(self, link): url = url_parse(link) if not url.scheme: link = get_ctx().record.url_to(link, base_url=get_ctx().base_url) - return LinkPattern.sanitize_url(self, link) + return Pattern.unescape(self, link) def sanitize_image(self, link): @@ -44,7 +47,7 @@ def sanitize_image(self, link): url = url_parse(link) if not url.scheme: link = get_ctx().record.url_to(link, alt=PRIMARY_ALT, base_url=get_ctx().base_url) - return LinkPattern.sanitize_url(self, link) + return Pattern.unescape(self, link) class LektorMarkdownExtension(Extension):