Commit 4af89c50 authored by Emanuil's avatar Emanuil
Browse files

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

parent 0352f01c
......@@ -528,7 +528,7 @@ class Parsedown
# 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)
......@@ -4,6 +4,7 @@
<p>Here's <a href="">one</a> on 2 lines.</p>
<p>Here's <a href="">one</a> with a different URL.</p>
<p>Here's <a href="">one</a> with a semantic name.</p>
<p>Here's <a href="">one</a> with definition name on the next line.</p>
<p>Here's [one][404] with no definition.</p>
<p>Here's an image: <img alt="Markdown Logo" src=""></p>
<p>Here's an <a href="">implicit one</a>.</p>
......@@ -22,6 +22,9 @@ Here's [one][website] with a semantic name.
Here's [one]
[website] with definition name on the next line.
Here's [one][404] with no definition.
Here's an image: ![Markdown Logo][image]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment