summaryrefslogtreecommitdiff
path: root/plugins/data.code.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/data.code.php')
-rwxr-xr-xplugins/data.code.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/data.code.php b/plugins/data.code.php
index 3cf90dd..6827977 100755
--- a/plugins/data.code.php
+++ b/plugins/data.code.php
@@ -1,6 +1,8 @@
<?php
-namespace Bitweaver;
+namespace Bitweaver\Liberty;
+
+use Bitweaver\KernelTools;
/**
* @version $Revision$
@@ -261,7 +263,10 @@ function data_code( $pData, $pParams ) { // Pre-Clyde Changes
break;
}
- $code = "<pre>$code</pre>";
+ // highlight_string() already wraps in <pre><code> in PHP 8.x
+ if( strpos( $code, '<pre>' ) === false ) {
+ $code = "<pre>$code</pre>";
+ }
}
return ( !empty( $title ) ? '<p class="codetitle">'.$title.'</p>' : "" )."<div class='codelisting'>".$code."</div>";