aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2025-08-10 17:15:42 -0400
committerlolcat <will@lolcat.ca>2025-08-10 17:15:42 -0400
commit2c2bd28a9ffbe6e55c9e6c1554f9c00f6bb31c3e (patch)
tree91ac8c1447be197bcbf729863e171506640146c1
parentdea8b0a3621c25566c2d8249bf18bfd223c80b9f (diff)
fix syntax highlighter
-rw-r--r--lib/frontend.php41
1 files changed, 18 insertions, 23 deletions
diff --git a/lib/frontend.php b/lib/frontend.php
index 41f9bad..4b98849 100644
--- a/lib/frontend.php
+++ b/lib/frontend.php
@@ -402,29 +402,24 @@ class frontend{
$text =
trim(
- preg_replace(
- '/<\/span>$/',
- "", // remove stray ending span because of the <?php stuff
- str_replace(
- [
- '<br />',
- '&nbsp;'
- ],
- [
- "\n", // replace <br> with newlines
- " " // replace html entity to space
- ],
- str_replace(
- [
- // leading <?php garbage
- "<span style=\"color: c-default\">\n&lt;?php&nbsp;",
- "<code>",
- "</code>"
- ],
- "",
- highlight_string("<?php " . $text, true)
- )
- )
+ str_replace(
+ [
+ "<br />",
+ "&nbsp;",
+ "<pre>",
+ "</pre>"
+ ],
+ [
+ "\n",
+ " ",
+ "",
+ ""
+ ],
+ explode(
+ "&lt;?php",
+ highlight_string("<?php " . $text, true),
+ 2
+ )[1]
)
);
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage