Markdown: fixed matching ( ) and { } in links

This commit is contained in:
Marcin Kurczewski 2013-11-25 11:50:34 +01:00
parent aa37ee66ff
commit 9819416f35

View file

@ -58,8 +58,8 @@ class CustomMarkdown extends \Michelf\Markdown
protected function doAutoLinks2($text)
{
$text = preg_replace_callback('{(?<!<)((https?|ftp):[^\'"><\s]+)}i', [&$this, '_doAutoLinks_url_callback'], $text);
$text = preg_replace_callback('{(?<![^\s\(\)\[\]])(www\.[^\'"><\s]+)}i', [&$this, '_doAutoLinks_url_callback'], $text);
$text = preg_replace_callback('{(?<!<)((https?|ftp):[^\'"><\s(){}]+)}i', [&$this, '_doAutoLinks_url_callback'], $text);
$text = preg_replace_callback('{(?<![^\s\(\)\[\]])(www\.[^\'"><\s(){}]+)}i', [&$this, '_doAutoLinks_url_callback'], $text);
return $text;
}