1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

PHP < 7 patch

This commit is contained in:
Aidan Woods 2019-04-06 18:30:57 +01:00
parent 3f74fe8347
commit 35d24d0b56
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -136,6 +136,11 @@ final class FencedCode implements ContinuableBlock
\strcspn($this->infostring(), " \t\n\f\r") \strcspn($this->infostring(), " \t\n\f\r")
); );
// only necessary pre-php7
if ($infostring === false) {
$infostring = '';
}
return new Element('pre', [], [new Element( return new Element('pre', [], [new Element(
'code', 'code',
$infostring !== '' ? ['class' => "language-{$infostring}"] : [], $infostring !== '' ? ['class' => "language-{$infostring}"] : [],