Fix html entities double encoding in html attributes

This commit is contained in:
Cerdic 2020-08-24 16:40:48 +02:00
parent 6598f3860c
commit 11ac7f6a59
3 changed files with 6 additions and 3 deletions

View File

@ -1918,7 +1918,7 @@ class Parsedown
protected static function escape($text, $allowQuotes = false)
{
return htmlspecialchars($text, $allowQuotes ? ENT_NOQUOTES : ENT_QUOTES, 'UTF-8');
return htmlspecialchars($text, $allowQuotes ? ENT_NOQUOTES : ENT_QUOTES, 'UTF-8', false);
}
protected static function striAtStart($string, $needle)

View File

@ -1,2 +1,3 @@
<p><img src="/md.png" alt="Markdown Logo" /></p>
<p>![missing reference]</p>
<p><img src="/md.png" alt="Markdown Logo with html entity as used in french&nbsp;!" /></p>

View File

@ -3,3 +3,5 @@
[image]: /md.png
![missing reference]
![Markdown Logo with html entity as used in french&nbsp;!][image]