Commit f5451a9e authored by Emanuil Rusev's avatar Emanuil Rusev
Browse files

Merge pull request #37 from hkdobrev/htmlspecialshars-utf8

parents 28064a63 849a89b1
......@@ -568,7 +568,7 @@ class Parsedown
case 'code_block':
case 'fenced_code_block':
$text = htmlspecialchars($element['text'], ENT_NOQUOTES);
$text = htmlspecialchars($element['text'], ENT_NOQUOTES, 'UTF-8');
strpos($text, "\x1A\\") !== FALSE and $text = strtr($text, $this->escape_sequence_map);
......@@ -634,7 +634,7 @@ class Parsedown
foreach ($matches as $matches)
{
$element_text = $matches[1];
$element_text = htmlspecialchars($element_text, ENT_NOQUOTES);
$element_text = htmlspecialchars($element_text, ENT_NOQUOTES, 'UTF-8');
# decodes escape sequences
......
<p>AT&amp;T has an ampersand in their name</p>
<pre><code>Let's play some cards ♠ ♣ ♥ ♦</code></pre>
<p>AT&amp;T is another way to write it</p>
<p>this &amp; that</p>
<p>4 &lt; 5 and 6 > 5</p>
......
AT&T has an ampersand in their name
Let's play some cards ♠ ♣ ♥ ♦
AT&T is another way to write it
this & that
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment