mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merged revisions 54619 via svnmerge from
svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2 ........ r54619 | sminnee | 2008-05-15 15:00:15 +1200 (Thu, 15 May 2008) | 1 line Fixed php/code snippets in forum posts ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@56907 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
172bf71ead
commit
b0c209a15d
@ -106,9 +106,10 @@ class BBCodeParser extends TextParser {
|
||||
function parse() {
|
||||
$this->content = str_replace(array('&', '<', '>'), array('&', '<', '>'), $this->content);
|
||||
$this->content = SSHTMLBBCodeParser::staticQparse($this->content);
|
||||
Debug::message($this->content);
|
||||
$this->content = "<p>".$this->content."</p>";
|
||||
$this->content = str_replace("\n\n", "</p><p>", $this->content);
|
||||
$this->content = str_replace("\n", "<br />", $this->content);
|
||||
$this->content = preg_replace("/([^>\s]\s*)\n\n/", '$1</p><p>', $this->content);
|
||||
$this->content = preg_replace("/([^>\s]\s*)\n/", '$1<br />', $this->content);
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
|
@ -65,8 +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' => 'pre',
|
||||
'htmlclose' => 'pre',
|
||||
'code' => array('htmlopen' => 'div class="codesnippet"',
|
||||
'htmlclose' => 'div',
|
||||
'allowed' => 'all',
|
||||
'attributes' => array()),
|
||||
'php' => array('htmlopen' => 'div class="codesnippet"',
|
||||
'htmlclose' => 'div',
|
||||
'allowed' => 'all',
|
||||
'attributes' => array()),
|
||||
'h1' => array('htmlopen' => 'h1',
|
||||
@ -96,7 +100,9 @@ class SSHTMLBBCodeParser_Filter_Extended extends SSHTMLBBCodeParser_Filter
|
||||
|
||||
);
|
||||
|
||||
|
||||
function _preparse() {
|
||||
$this->_preparsed = str_replace("\t", " ", $this->_text);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user