Fix an error in markdown2.py transformation, : character doesn't need to be encoded when converting an URL

This commit is contained in:
Gregory Soutade 2022-10-08 16:07:41 +02:00
parent 2bd6f8ae21
commit c5744585c7

View File

@ -1273,7 +1273,7 @@ class Markdown(object):
if is_inline_img:
img_class_str = ' class="inlineimage"'
result = '<img src="%s" alt="%s"%s%s%s' \
% (urllib.parse.quote(url),
% (urllib.parse.quote(url, safe=':/'),
_xml_escape_attr(link_text),
title_str, img_class_str, self.empty_element_suffix)
if "smarty-pants" in self.extras:
@ -1323,7 +1323,7 @@ class Markdown(object):
if is_img:
img_class_str = self._html_class_str_from_tag("img")
result = '<img src="%s" alt="%s"%s%s%s' \
% (urllib.parse.quote(url),
% (urllib.parse.quote(url, safe=':/'),
link_text.replace('"', '&quot;'),
title_str, img_class_str, self.empty_element_suffix)
if "smarty-pants" in self.extras: