mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
CommonMark escapes double-quotes
This commit is contained in:
parent
d6c97ee111
commit
2e0ad27c5e
@ -33,6 +33,7 @@
|
||||
<referencedMethod name="Erusev\Parsedown\Configurables\BlockTypes::removing" />
|
||||
<referencedMethod name="Erusev\Parsedown\Configurables\Breaks::enabled" />
|
||||
<referencedMethod name="Erusev\Parsedown\State::mergingWith" />
|
||||
<referencedMethod name="Erusev\Parsedown\Html\Sanitisation\Escaper::htmlElementValue" />
|
||||
</errorLevel>
|
||||
</PossiblyUnusedMethod>
|
||||
</issueHandlers>
|
||||
|
@ -29,6 +29,6 @@ final class Text implements Renderable
|
||||
/** @return string */
|
||||
public function getHtml()
|
||||
{
|
||||
return Escaper::htmlElementValue($this->text);
|
||||
return Escaper::htmlElementValueEscapingDoubleQuotes($this->text);
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,15 @@ final class Escaper
|
||||
return self::escape($text, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $text
|
||||
* @return string
|
||||
*/
|
||||
public static function htmlElementValueEscapingDoubleQuotes($text)
|
||||
{
|
||||
return \htmlspecialchars($text, \ENT_COMPAT, 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $text
|
||||
* @param bool $allowQuotes
|
||||
|
@ -124,12 +124,12 @@ MARKDOWN_WITH_MARKUP;
|
||||
<p><div><em>content</em></div></p>
|
||||
<p>sparse:</p>
|
||||
<p><div>
|
||||
<div class="inner">
|
||||
<div class="inner">
|
||||
<em>content</em>
|
||||
</div>
|
||||
</div></p>
|
||||
<p>paragraph</p>
|
||||
<p><style type="text/css">
|
||||
<p><style type="text/css">
|
||||
p {
|
||||
color: red;
|
||||
}
|
||||
|
@ -6,9 +6,9 @@ echo $message;</code></pre>
|
||||
<pre><code class="language-php">echo 'language identifier';</code></pre>
|
||||
<pre><code class="language-c#">echo 'language identifier with non words';</code></pre>
|
||||
<pre><code class="language-html+php"><?php
|
||||
echo "Hello World";
|
||||
echo "Hello World";
|
||||
?>
|
||||
<a href="http://auraphp.com" >Aura Project</a></code></pre>
|
||||
<a href="http://auraphp.com" >Aura Project</a></code></pre>
|
||||
<pre><code>the following isn't quite enough to close
|
||||
```
|
||||
still a fenced code block</code></pre>
|
||||
|
@ -3,4 +3,4 @@
|
||||
$message = 'Hello World!';
|
||||
echo $message;
|
||||
|
||||
echo "following a blank line";</code></pre>
|
||||
echo "following a blank line";</code></pre>
|
Loading…
Reference in New Issue
Block a user