mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Parser: Fix for line-breaks when converting HTML back to plain text.
This commit is contained in:
parent
955af62106
commit
e15a10234e
@ -2463,6 +2463,7 @@ class e_parse extends e_parser
|
||||
if($this->isHtml($text) === true) // strip any html.
|
||||
{
|
||||
$text = $this->toHTML($text,true);
|
||||
$text = str_ireplace( array("<br>","<br />","<br/>"), "\n", $text);
|
||||
$text = strip_tags($text);
|
||||
}
|
||||
|
||||
|
@ -497,6 +497,7 @@ TMP;
|
||||
$arr = array(
|
||||
0 => array('html'=>"<h1><a href='#'>My Caption</a></h1>", 'expected' => 'My Caption'),
|
||||
1 => array('html'=>"<div><h1><a href='#'>My Caption</a></h1></div>", 'expected' => 'My Caption'),
|
||||
2 => array('html'=>'Line 1<br />Line 2<br />Line 3<br />', 'expected'=> "Line 1\nLine 2\nLine 3\n"),
|
||||
);
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user