From 99bcc33b38a774c2b5aad61c56b5db7aae34a5ce Mon Sep 17 00:00:00 2001 From: Anaggh S Date: Wed, 3 Apr 2019 19:35:50 +0530 Subject: [PATCH] Update parsedown 1.7.1 -> 1.7.3 --- bl-kernel/parsedown.class.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/bl-kernel/parsedown.class.php b/bl-kernel/parsedown.class.php index 87d612ab..a34b44f0 100644 --- a/bl-kernel/parsedown.class.php +++ b/bl-kernel/parsedown.class.php @@ -17,7 +17,7 @@ class Parsedown { # ~ - const version = '1.7.1'; + const version = '1.7.3'; # ~ @@ -429,7 +429,21 @@ class Parsedown if (isset($matches[1])) { - $class = 'language-'.$matches[1]; + /** + * 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($matches[1], 0, strcspn($matches[1], " \t\n\f\r")); + + $class = 'language-'.$language; $Element['attributes'] = array( 'class' => $class,