File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -429,7 +429,21 @@ protected function blockFencedCode($Line)
429429
430430 if (isset ($ matches [1 ]))
431431 {
432- $ class = 'language- ' .$ matches [1 ];
432+ /**
433+ * https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#classes
434+ * Every HTML element may have a class attribute specified.
435+ * The attribute, if specified, must have a value that is a set
436+ * of space-separated tokens representing the various classes
437+ * that the element belongs to.
438+ * [...]
439+ * The space characters, for the purposes of this specification,
440+ * are U+0020 SPACE, U+0009 CHARACTER TABULATION (tab),
441+ * U+000A LINE FEED (LF), U+000C FORM FEED (FF), and
442+ * U+000D CARRIAGE RETURN (CR).
443+ */
444+ $ language = substr ($ matches [1 ], 0 , strcspn ($ matches [1 ], " \t\n\f\r" ));
445+
446+ $ class = 'language- ' .$ language ;
433447
434448 $ Element ['attributes ' ] = array (
435449 'class ' => $ class ,
You can’t perform that action at this time.
0 commit comments