From 96dd69f7f9b99a8087f626b456cd1d3918ea8387 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Mon, 13 Oct 2008 19:50:19 -0400 Subject: Fixed the url sanitation after recent refactor. All tests pass now. --- markdown.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/markdown.py b/markdown.py index 77610f9..d9bd938 100755 --- a/markdown.py +++ b/markdown.py @@ -1347,7 +1347,7 @@ class LinkPattern (Pattern): if ":" in part: safe_url = False - if self.safe_mode and not safe_url: + if self.markdown.safeMode and not safe_url: return '' else: return urlunparse(url) @@ -1815,15 +1815,16 @@ class Markdown: ">backtick") self.inlinePatterns.add("reference", ReferencePattern(REFERENCE_RE, self), ">escape") - self.inlinePatterns.add("link", LinkPattern(LINK_RE), ">reference") - self.inlinePatterns.add("image_link", ImagePattern(IMAGE_LINK_RE), + self.inlinePatterns.add("link", LinkPattern(LINK_RE, self), + ">reference") + self.inlinePatterns.add("image_link", ImagePattern(IMAGE_LINK_RE, self), ">link") self.inlinePatterns.add("image_reference", ImageReferencePattern(IMAGE_REFERENCE_RE, self), ">image_link") - self.inlinePatterns.add("autolink", AutolinkPattern(AUTOLINK_RE), + self.inlinePatterns.add("autolink", AutolinkPattern(AUTOLINK_RE, self), ">image_reference") - self.inlinePatterns.add("automail", AutomailPattern(AUTOMAIL_RE), + self.inlinePatterns.add("automail", AutomailPattern(AUTOMAIL_RE, self), ">autolink") self.inlinePatterns.add("linebreak2", SubstituteTagPattern(LINE_BREAK_2_RE, 'br'), -- cgit v1.2.3