diff --git a/Michelf/Markdown.php b/Michelf/Markdown.php index 096b985..25b903f 100644 --- a/Michelf/Markdown.php +++ b/Michelf/Markdown.php @@ -617,6 +617,12 @@ class Markdown implements MarkdownInterface { $url = $matches[3] == '' ? $matches[4] : $matches[3]; $title =& $matches[7]; + // if the URL was of the form it got caught by the HTML + // tag parser and hashed. Need to reverse the process before using the URL. + $unhashed = $this->unhash($url); + if ($unhashed != $url) + $url = preg_replace('/^<(.*)>$/', '\1', $unhashed); + $url = $this->encodeAttribute($url); $result = "doExtraAttributes("a", $dummy =& $matches[8]); + // if the URL was of the form it got caught by the HTML + // tag parser and hashed. Need to reverse the process before using the URL. + $unhashed = $this->unhash($url); + if ($unhashed != $url) + $url = preg_replace('/^<(.*)>$/', '\1', $unhashed); $url = $this->encodeAttribute($url);