forked from science-ation/science-ation
also convert an ending </div> into a newline when converting html to text
This commit is contained in:
parent
3fce787126
commit
cbab7c7fa8
@ -1306,6 +1306,8 @@ function format_duration($seconds, $granularity = 2)
|
||||
function getTextFromHtml($html) {
|
||||
//first, replace an </p> with </p><br />
|
||||
$text=str_replace("</p>","</p><br />",$html);
|
||||
//next, replace a </div> with </div><br />
|
||||
$text=str_replace("</div>","</div><br />",$html);
|
||||
//now replace any <br /> with newlines
|
||||
$text=eregi_replace('<br[[:space:]]*/?[[:space:]]*>',chr(13).chr(10),$text);
|
||||
//and strip the rest of the tags
|
||||
|
Loading…
Reference in New Issue
Block a user