mirror of
https://github.com/erusev/parsedown.git
synced 2024-09-20 03:51:29 +02: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\BlockTypes::removing" />
|
||||||
<referencedMethod name="Erusev\Parsedown\Configurables\Breaks::enabled" />
|
<referencedMethod name="Erusev\Parsedown\Configurables\Breaks::enabled" />
|
||||||
<referencedMethod name="Erusev\Parsedown\State::mergingWith" />
|
<referencedMethod name="Erusev\Parsedown\State::mergingWith" />
|
||||||
|
<referencedMethod name="Erusev\Parsedown\Html\Sanitisation\Escaper::htmlElementValue" />
|
||||||
</errorLevel>
|
</errorLevel>
|
||||||
</PossiblyUnusedMethod>
|
</PossiblyUnusedMethod>
|
||||||
</issueHandlers>
|
</issueHandlers>
|
||||||
|
@ -29,6 +29,6 @@ final class Text implements Renderable
|
|||||||
/** @return string */
|
/** @return string */
|
||||||
public function getHtml()
|
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);
|
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 string $text
|
||||||
* @param bool $allowQuotes
|
* @param bool $allowQuotes
|
||||||
|
@ -124,12 +124,12 @@ MARKDOWN_WITH_MARKUP;
|
|||||||
<p><div><em>content</em></div></p>
|
<p><div><em>content</em></div></p>
|
||||||
<p>sparse:</p>
|
<p>sparse:</p>
|
||||||
<p><div>
|
<p><div>
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<em>content</em>
|
<em>content</em>
|
||||||
</div>
|
</div>
|
||||||
</div></p>
|
</div></p>
|
||||||
<p>paragraph</p>
|
<p>paragraph</p>
|
||||||
<p><style type="text/css">
|
<p><style type="text/css">
|
||||||
p {
|
p {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,9 @@ echo $message;</code></pre>
|
|||||||
<pre><code class="language-php">echo 'language identifier';</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-c#">echo 'language identifier with non words';</code></pre>
|
||||||
<pre><code class="language-html+php"><?php
|
<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
|
<pre><code>the following isn't quite enough to close
|
||||||
```
|
```
|
||||||
still a fenced code block</code></pre>
|
still a fenced code block</code></pre>
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
$message = 'Hello World!';
|
$message = 'Hello World!';
|
||||||
echo $message;
|
echo $message;
|
||||||
|
|
||||||
echo "following a blank line";</code></pre>
|
echo "following a blank line";</code></pre>
|
Loading…
Reference in New Issue
Block a user