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:
parent
44686c4f1e
commit
4dde57451d
@ -1136,7 +1136,7 @@ class Parsedown
|
||||
|
||||
$substring = substr($excerpt, $extent);
|
||||
|
||||
if (preg_match('/^\s*\[(.+?)\]/', $substring, $matches))
|
||||
if (preg_match('/^\s*\[([^][]+)\]/', $substring, $matches))
|
||||
{
|
||||
$Link['label'] = strtolower($matches[1]);
|
||||
|
||||
|
@ -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 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>
|
@ -4,6 +4,10 @@ an [implicit] reference link
|
||||
|
||||
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
|
||||
|
||||
[example]: http://example.com "Example"
|
Loading…
Reference in New Issue
Block a user