diff options
author | redmatrix <git@macgirvin.com> | 2016-06-15 22:36:00 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-06-15 22:36:00 -0700 |
commit | a2a87fec54e9da8defea30b8e252a8691a83dfc0 (patch) | |
tree | 23952b0a6071a832dacdb0cd76142ccd34338b1c | |
parent | d457f11717da40f44d98eeba5b88e6f1e5636247 (diff) | |
download | volse-hubzilla-a2a87fec54e9da8defea30b8e252a8691a83dfc0.tar.gz volse-hubzilla-a2a87fec54e9da8defea30b8e252a8691a83dfc0.tar.bz2 volse-hubzilla-a2a87fec54e9da8defea30b8e252a8691a83dfc0.zip |
code comments
-rw-r--r-- | include/text.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php index 59190a9ca..50a3d8892 100644 --- a/include/text.php +++ b/include/text.php @@ -2899,6 +2899,11 @@ function text_highlight($s,$lang) { $tag_added = false; $s = trim(html_entity_decode($s,ENT_COMPAT)); $s = str_replace(" ","\t",$s); + + // The highlighter library insists on an opening php tag for php code blocks. If + // it isn't present, nothing is highlighted. So we're going to see if it's present. + // If not, we'll add it, and then quietly remove it after we get the processed output back. + if($lang === 'php') { if(strpos('<?php',$s) !== 0) { $s = '<?php' . "\n" . $s; |