diff --git a/parsers/BBCodeParser.php b/parsers/BBCodeParser.php index b35d93282..f69c26797 100644 --- a/parsers/BBCodeParser.php +++ b/parsers/BBCodeParser.php @@ -107,6 +107,10 @@ class BBCodeParser extends TextParser { $this->content = str_replace(array('&', '<', '>'), array('&', '<', '>'), $this->content); $this->content = SSHTMLBBCodeParser::staticQparse($this->content); $this->content = "
".$this->content."
"; + + $this->content = preg_replace('/(]*>)\s+/i', '\\1', $this->content); + $this->content = preg_replace('/\s+(<\/p[^>]*>)/i', '\\1', $this->content); + $this->content = preg_replace("/\n\s*\n/", "
", $this->content);
$this->content = str_replace("\n", "
", $this->content);
return $this->content;
diff --git a/parsers/HTML/BBCodeParser/Filter/Extended.php b/parsers/HTML/BBCodeParser/Filter/Extended.php
index 7f49dafc9..9858ad4c9 100644
--- a/parsers/HTML/BBCodeParser/Filter/Extended.php
+++ b/parsers/HTML/BBCodeParser/Filter/Extended.php
@@ -65,12 +65,12 @@ class SSHTMLBBCodeParser_Filter_Extended extends SSHTMLBBCodeParser_Filter
'htmlclose' => 'q',
'allowed' => 'all',
'attributes'=> array('quote' =>'cite=%2$s%1$s%2$s')),
- 'code' => array('htmlopen' => 'div class="codesnippet"',
- 'htmlclose' => 'div',
+ 'code' => array('htmlopen' => 'div class="codesnippet">
'p> 'all', 'attributes' => array()), - 'php' => array('htmlopen' => 'div class="codesnippet"', - 'htmlclose' => 'div', + 'php' => array('htmlopen' => 'div class="codesnippet">
'p> 'all', 'attributes' => array()), 'h1' => array('htmlopen' => 'h1',