1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

fix consecutive reference links

This commit is contained in:
Emanuil Rusev 2014-05-06 17:05:49 +03:00
parent 44686c4f1e
commit 4dde57451d
3 changed files with 6 additions and 1 deletions

View File

@ -1136,7 +1136,7 @@ class Parsedown
$substring = substr($excerpt, $extent); $substring = substr($excerpt, $extent);
if (preg_match('/^\s*\[(.+?)\]/', $substring, $matches)) if (preg_match('/^\s*\[([^][]+)\]/', $substring, $matches))
{ {
$Link['label'] = strtolower($matches[1]); $Link['label'] = strtolower($matches[1]);

View File

@ -1,3 +1,4 @@
<p>an <a href="http://example.com">implicit</a> reference link</p> <p>an <a href="http://example.com">implicit</a> reference link</p>
<p>an <a href="http://example.com">implicit</a> reference link with an empty link definition</p> <p>an <a href="http://example.com">implicit</a> reference link with an empty link definition</p>
<p>an <a href="http://example.com">implicit</a> reference link followed by <a href="http://cnn.com">another</a></p>
<p>an <a href="http://example.com" title="Example">explicit</a> reference link with a title</p> <p>an <a href="http://example.com" title="Example">explicit</a> reference link with a title</p>

View File

@ -4,6 +4,10 @@ an [implicit] reference link
an [implicit][] reference link with an empty link definition an [implicit][] reference link with an empty link definition
an [implicit][] reference link followed by [another][]
[another]: http://cnn.com
an [explicit][example] reference link with a title an [explicit][example] reference link with a title
[example]: http://example.com "Example" [example]: http://example.com "Example"