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

Merge pull request #284 from jstanden/master

Fixes #283
This commit is contained in:
Emanuil Rusev 2015-02-04 00:39:05 +02:00
commit 618b26056c
5 changed files with 12 additions and 3 deletions

View File

@ -1197,7 +1197,7 @@ class Parsedown
return;
}
if (preg_match('/^[(]((?:[^ ()]|[(][^ )]+[)])+)(?:[ ]+("[^"]+"|\'[^\']+\'))?[)]/', $remainder, $matches))
if (preg_match('/^[(]((?:[^ ()]|[(][^ )]+[)])+)(?:[ ]+("[^"]*"|\'[^\']*\'))?[)]/', $remainder, $matches))
{
$Element['attributes']['href'] = $matches[1];

View File

@ -1 +1,2 @@
<p><img src="/md.png" alt="alt" title="title" /></p>
<p><img src="/md.png" alt="alt" title="title" /></p>
<p><img src="/md.png" alt="blank title" title="" /></p>

View File

@ -1 +1,3 @@
![alt](/md.png "title")
![alt](/md.png "title")
![blank title](/md.png "")

View File

@ -1,4 +1,6 @@
<p><a href="http://example.com" title="Title">single quotes</a></p>
<p><a href="http://example.com" title="Title">double quotes</a></p>
<p><a href="http://example.com" title="">single quotes blank</a></p>
<p><a href="http://example.com" title="">double quotes blank</a></p>
<p><a href="http://example.com" title="2 Words">space</a></p>
<p><a href="http://example.com/url-(parentheses)" title="Title">parentheses</a></p>

View File

@ -2,6 +2,10 @@
[double quotes](http://example.com "Title")
[single quotes blank](http://example.com '')
[double quotes blank](http://example.com "")
[space](http://example.com "2 Words")
[parentheses](http://example.com/url-(parentheses) "Title")