mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merged revisions 56631 via svnmerge from
svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2 ........ r56631 | sminnee | 2008-06-20 12:45:34 +1200 (Fri, 20 Jun 2008) | 1 line Improved BBCode parser ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@56913 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
4d616597ad
commit
5da717ed1d
@ -107,10 +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("/([^>\s]\s*)\n\n/", '$1</p><p>', $this->content);
|
||||
$this->content = preg_replace("/([^>\s]\s*)\n/", '$1<br />', $this->content);
|
||||
$this->content = preg_replace("/\n\s*\n/", "</p><p>", $this->content);
|
||||
$this->content = str_replace("\n", "<br />", $this->content);
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
@ -102,7 +102,9 @@ class SSHTMLBBCodeParser_Filter_Extended extends SSHTMLBBCodeParser_Filter
|
||||
|
||||
function _preparse() {
|
||||
$this->_preparsed = str_replace("\t", " ", $this->_text);
|
||||
$this->_preparsed = preg_replace("/(\[php\])\s*/", '$1', $this->_preparsed);
|
||||
$this->_preparsed = preg_replace("/\s*(\[\/php\])\s/", '$1', $this->_preparsed);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user