Commit 70b0dd78 by Carsten Brandt

improvements to php codehighlight

parent 1ecc7752
...@@ -39,9 +39,12 @@ class ApiMarkdown extends Markdown ...@@ -39,9 +39,12 @@ class ApiMarkdown extends Markdown
} else { } else {
$text = highlight_string("<?php ".trim($block['text']), true); $text = highlight_string("<?php ".trim($block['text']), true);
$text = str_replace('&lt;?php', '', $text); $text = str_replace('&lt;?php', '', $text);
if (($pos = strpos($text, '&nbsp;')) !== false) {
$text = substr($text, 0, $pos) . substr($text, $pos + 6);
}
} }
// remove <code> tags added by php // remove <code><span style="color: #000000">\n and </span>tags added by php
$text = substr(trim($text), 6, -7); $text = substr(trim($text), 36, -16);
$code = '<pre><code'; $code = '<pre><code';
if (isset($block['language'])) if (isset($block['language']))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment