Skip to content
Browse files

Unmangle the NBBC-parsed content inside the [code]...[/code] tag befo…

…re handing it off for syntax highlighting.
  • Loading branch information...
1 parent 7b4e588 commit a4e4d8ae883a6b3ed9b03954697337a4037f9005 @phred phred committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 plugins/NBBC/class.nbbc.plugin.php
View
8 plugins/NBBC/class.nbbc.plugin.php
@@ -93,7 +93,7 @@ public function FormatCode($String, $Lang) {
return $String;
}
else {
- return $Formatter->FormatCode(htmlspecialchars_decode($String), $Lang);
+ return $Formatter->FormatCode($String, $Lang);
}
}
@@ -101,8 +101,11 @@ function DoCode($bbcode, $action, $name, $default, $params, $content) {
if ($action == BBCODE_CHECK)
return true;
+ $UnformattedContent = str_replace("<br />", "", $content);
+ $UnformattedContent = htmlspecialchars_decode($UnformattedContent);
+
$Lang = ($params['lang'] ? $params['lang'] : "html4strict");
- return $this->FormatCode($content, $Lang);
+ return $this->FormatCode($UnformattedContent, $Lang);
}
protected $_NBBC = NULL;
@@ -124,6 +127,7 @@ public function NBBC() {
'after_endtag' => "sns",
'plain_start' => "\n<b>Code:</b>\n",
'plain_end' => "\n",
+ 'raw_content' => true
));
$BBCode->AddRule('quote',

0 comments on commit a4e4d8a

Please sign in to comment.
Something went wrong with that request. Please try again.