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

simplify compiling

This commit is contained in:
Emanuil Rusev 2014-01-19 23:34:20 +02:00
parent 2b73e94c6c
commit 354842fd6e

View File

@ -579,15 +579,22 @@ class Parsedown
break;
case 'code block':
$text = htmlspecialchars($element['text'], ENT_NOQUOTES, 'UTF-8');
$markup .= '<pre><code>'.$text.'</code></pre>'."\n";
break;
case 'fenced block':
$text = htmlspecialchars($element['text'], ENT_NOQUOTES, 'UTF-8');
$markup .= isset($element['language'])
? '<pre><code class="language-'.$element['language'].'">'.$text.'</code></pre>'
: '<pre><code>'.$text.'</code></pre>';
$markup .= '<pre><code';
$markup .= "\n";
isset($element['language']) and $markup .= ' class="language-'.$element['language'].'"';
$markup .= '>'.$text.'</code></pre>'."\n";
break;