Merge branch '1.8.x-beta'

This commit is contained in:
Aidan Woods 2019-04-06 17:58:29 +01:00
commit 3825db53a2
1 changed files with 16 additions and 2 deletions

View File

@ -17,7 +17,7 @@ class Parsedown
{
# ~
const version = '1.8.0-beta-5';
const version = '1.8.0-beta-7';
# ~
@ -470,7 +470,21 @@ class Parsedown
if ($infostring !== '')
{
$Element['attributes'] = array('class' => "language-$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).
*/
$language = substr($infostring, 0, strcspn($infostring, " \t\n\f\r"));
$Element['attributes'] = array('class' => "language-$language");
}
$Block = array(