fix syntax highlighter
This commit is contained in:
parent
dea8b0a362
commit
2c2bd28a9f
|
@ -402,29 +402,24 @@ class frontend{
|
||||||
|
|
||||||
$text =
|
$text =
|
||||||
trim(
|
trim(
|
||||||
preg_replace(
|
str_replace(
|
||||||
'/<\/span>$/',
|
[
|
||||||
"", // remove stray ending span because of the <?php stuff
|
"<br />",
|
||||||
str_replace(
|
" ",
|
||||||
[
|
"<pre>",
|
||||||
'<br />',
|
"</pre>"
|
||||||
' '
|
],
|
||||||
],
|
[
|
||||||
[
|
"\n",
|
||||||
"\n", // replace <br> with newlines
|
" ",
|
||||||
" " // replace html entity to space
|
"",
|
||||||
],
|
""
|
||||||
str_replace(
|
],
|
||||||
[
|
explode(
|
||||||
// leading <?php garbage
|
"<?php",
|
||||||
"<span style=\"color: c-default\">\n<?php ",
|
highlight_string("<?php " . $text, true),
|
||||||
"<code>",
|
2
|
||||||
"</code>"
|
)[1]
|
||||||
],
|
|
||||||
"",
|
|
||||||
highlight_string("<?php " . $text, true)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue