mirror of
https://github.com/erusev/parsedown.git
synced 2024-09-20 03:51:29 +02:00
resolve #274
This commit is contained in:
parent
70e7a17380
commit
4d3079b908
@ -1199,7 +1199,7 @@ class Parsedown
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/^[(]((?:[^ (]|[(][^ )]+[)])+)(?:[ ]+("[^"]+"|\'[^\']+\'))?[)]/', $remainder, $matches))
|
if (preg_match('/^[(]((?:[^ ()]|[(][^ )]+[)])+)(?:[ ]+("[^"]+"|\'[^\']+\'))?[)]/', $remainder, $matches))
|
||||||
{
|
{
|
||||||
$Element['attributes']['href'] = $matches[1];
|
$Element['attributes']['href'] = $matches[1];
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
<p><a href="http://example.com">link</a> and <a href="/url-with-(parentheses)">another link</a></p>
|
<p><a href="http://example.com">link</a></p>
|
||||||
|
<p><a href="/url-(parentheses)">link</a> with parentheses in URL </p>
|
||||||
|
<p>(<a href="/index.php">link</a>) in parentheses</p>
|
||||||
<p><a href="http://example.com"><code>link</code></a></p>
|
<p><a href="http://example.com"><code>link</code></a></p>
|
||||||
<p><a href="http://example.com"><img src="http://parsedown.org/md.png" alt="MD Logo" /></a></p>
|
<p><a href="http://example.com"><img src="http://parsedown.org/md.png" alt="MD Logo" /></a></p>
|
||||||
<p><a href="http://example.com"><img src="http://parsedown.org/md.png" alt="MD Logo" /> and text</a></p>
|
<p><a href="http://example.com"><img src="http://parsedown.org/md.png" alt="MD Logo" /> and text</a></p>
|
@ -1,4 +1,8 @@
|
|||||||
[link](http://example.com) and [another link](/url-with-(parentheses))
|
[link](http://example.com)
|
||||||
|
|
||||||
|
[link](/url-(parentheses)) with parentheses in URL
|
||||||
|
|
||||||
|
([link](/index.php)) in parentheses
|
||||||
|
|
||||||
[`link`](http://example.com)
|
[`link`](http://example.com)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user