1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00
codebase
This commit is contained in:
Aidan Woods 2019-04-06 18:15:28 +01:00
parent 710a6ad250
commit 3f74fe8347
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
3 changed files with 25 additions and 1 deletions

View File

@ -118,7 +118,23 @@ final class FencedCode implements ContinuableBlock
*/
public function stateRenderable()
{
$infostring = $this->infostring();
/**
* https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#classes
* Every HTML element may have a class attribute specified.
* The attribute, if specified, must have a value that is a set
* of space-separated tokens representing the various classes
* that the element belongs to.
* [...]
* The space characters, for the purposes of this specification,
* are U+0020 SPACE, U+0009 CHARACTER TABULATION (tab),
* U+000A LINE FEED (LF), U+000C FORM FEED (FF), and
* U+000D CARRIAGE RETURN (CR).
*/
$infostring = \substr(
$this->infostring(),
0,
\strcspn($this->infostring(), " \t\n\f\r")
);
return new Element('pre', [], [new Element(
'code',

View File

@ -22,4 +22,7 @@ still a fenced code block
bar
</code></pre>
<pre><code class="language-php">&lt;?php
echo &quot;Hello World&quot;;
</code></pre>

View File

@ -35,4 +35,9 @@ foo
bar
```
```php some-class
<?php
echo "Hello World";
```