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

reference links should be able to have their names on the next line

This commit is contained in:
Emanuil 2013-08-31 22:27:38 +03:00
parent 0352f01c7e
commit 4af89c5087
3 changed files with 5 additions and 1 deletions

View File

@ -528,7 +528,7 @@ class Parsedown
# Reference(d) Link / Image # Reference(d) Link / Image
if ($this->reference_map and strpos($text, '[') !== FALSE and preg_match_all('/(!?)\[(.+?)\](?:[ ]?\[(.*?)\])?/ms', $text, $matches, PREG_SET_ORDER)) if ($this->reference_map and strpos($text, '[') !== FALSE and preg_match_all('/(!?)\[(.+?)\](?:\n?[ ]?\[(.*?)\])?/ms', $text, $matches, PREG_SET_ORDER))
{ {
foreach ($matches as $matches) foreach ($matches as $matches)
{ {

View File

@ -4,6 +4,7 @@
<p>Here's <a href="http://parsedown.org">one</a> on 2 lines.</p> <p>Here's <a href="http://parsedown.org">one</a> on 2 lines.</p>
<p>Here's <a href="http://parsedown.org/tests/">one</a> with a different URL.</p> <p>Here's <a href="http://parsedown.org/tests/">one</a> with a different URL.</p>
<p>Here's <a href="http://parsedown.org">one</a> with a semantic name.</p> <p>Here's <a href="http://parsedown.org">one</a> with a semantic name.</p>
<p>Here's <a href="http://parsedown.org">one</a> with definition name on the next line.</p>
<p>Here's [one][404] with no definition.</p> <p>Here's [one][404] with no definition.</p>
<p>Here's an image: <img alt="Markdown Logo" src="https://raw.github.com/dcurtis/markdown-mark/master/png/32x20-solid.png"></p> <p>Here's an image: <img alt="Markdown Logo" src="https://raw.github.com/dcurtis/markdown-mark/master/png/32x20-solid.png"></p>
<p>Here's an <a href="http://google.com">implicit one</a>.</p> <p>Here's an <a href="http://google.com">implicit one</a>.</p>

View File

@ -22,6 +22,9 @@ Here's [one][website] with a semantic name.
[website]: http://parsedown.org [website]: http://parsedown.org
Here's [one]
[website] with definition name on the next line.
Here's [one][404] with no definition. Here's [one][404] with no definition.
Here's an image: ![Markdown Logo][image] Here's an image: ![Markdown Logo][image]