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

labels of reference links should be case insensitive

This commit is contained in:
Emanuil Rusev 2013-11-08 21:59:26 +02:00
parent 400c8f7d46
commit 4403fe4d96
3 changed files with 6 additions and 1 deletions

View File

@ -283,7 +283,7 @@ class Parsedown
if ($pure_line[0] === '[' and preg_match('/^\[(.+?)\]:[ ]*([^ ]+)/', $pure_line, $matches))
{
$label = $matches[1];
$label = strtolower($matches[1]);
$url = trim($matches[2], '<>');
$this->reference_map[$label] = $url;

View File

@ -2,6 +2,7 @@
<p>Here's <a href="http://parsedown.org">one</a> on the next line.</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 an upper case label definition.</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 an image: <img alt="Markdown Logo" src="/md.png"></p>

View File

@ -13,6 +13,10 @@ Here's [one][website] with a semantic name.
[website]: http://parsedown.org
Here's [one][case] with an upper case label definition.
[CASE]: http://parsedown.org
Here's [one]
[website] with definition name on the next line.