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

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) 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) protected static function striAtStart($string, $needle)

View File

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