Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CentralNic
parsedown
Commits
4403fe4d
Commit
4403fe4d
authored
Nov 08, 2013
by
Emanuil Rusev
Browse files
labels of reference links should be case insensitive
parent
400c8f7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Parsedown.php
View file @
4403fe4d
...
...
@@ -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
;
...
...
tests/data/reference_link.html
View file @
4403fe4d
...
...
@@ -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>
...
...
tests/data/reference_link.md
View file @
4403fe4d
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment