mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Improved rendering of [php] tags in BBCode view
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@68873 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
4b2b3e3c5b
commit
10ee07db0d
@ -107,6 +107,10 @@ class BBCodeParser extends TextParser {
|
||||
$this->content = str_replace(array('&', '<', '>'), array('&', '<', '>'), $this->content);
|
||||
$this->content = SSHTMLBBCodeParser::staticQparse($this->content);
|
||||
$this->content = "<p>".$this->content."</p>";
|
||||
|
||||
$this->content = preg_replace('/(<p[^>]*>)\s+/i', '\\1', $this->content);
|
||||
$this->content = preg_replace('/\s+(<\/p[^>]*>)/i', '\\1', $this->content);
|
||||
|
||||
$this->content = preg_replace("/\n\s*\n/", "</p><p>", $this->content);
|
||||
$this->content = str_replace("\n", "<br />", $this->content);
|
||||
return $this->content;
|
||||
|
@ -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',
|
||||
'htmlclose' => 'p></div',
|
||||
'allowed' => 'all',
|
||||
'attributes' => array()),
|
||||
'php' => array('htmlopen' => 'div class="codesnippet"',
|
||||
'htmlclose' => 'div',
|
||||
'php' => array('htmlopen' => 'div class="codesnippet"><p',
|
||||
'htmlclose' => 'p></div',
|
||||
'allowed' => 'all',
|
||||
'attributes' => array()),
|
||||
'h1' => array('htmlopen' => 'h1',
|
||||
|
Loading…
Reference in New Issue
Block a user