1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00
This commit is contained in:
Emanuil Rusev 2014-01-19 00:52:07 +02:00
parent 1017f22cdd
commit f5dd3455f9
5 changed files with 13 additions and 5 deletions

View File

@ -825,9 +825,18 @@ class Parsedown
case '&':
$markup .= '&';
if (preg_match('/^&#?\w+;/', $text, $matches))
{
$markup .= $matches[0];
$offset = substr($text, 0, 5) === '&' ? 5 : 1;
$offset = strlen($matches[0]);
}
else
{
$markup .= '&';
$offset = 1;
}
break;

View File

@ -0,0 +1 @@
<p>&amp; &copy; &#123;</p>

View File

@ -0,0 +1 @@
&amp; &copy; &#123;

View File

@ -1,5 +1,4 @@
<p>AT&amp;T has an ampersand in their name</p>
<p>AT&amp;T is another way to write it</p>
<p>this &amp; that</p>
<p>4 &lt; 5 and 6 > 5</p>
<p><a href="http://example.com/autolink?a=1&amp;b=2">http://example.com/autolink?a=1&amp;b=2</a></p>

View File

@ -1,7 +1,5 @@
AT&T has an ampersand in their name
AT&T is another way to write it
this & that
4 < 5 and 6 > 5