forked from GNUsocial/gnu-social
Issue #279 raises the point of missing newlines
This commit is contained in:
parent
a75b1df627
commit
56e2b0007c
@ -2611,6 +2611,9 @@ function common_log_delta($comment=null)
|
|||||||
|
|
||||||
function common_strip_html($html, $trim=true, $save_whitespace=false)
|
function common_strip_html($html, $trim=true, $save_whitespace=false)
|
||||||
{
|
{
|
||||||
|
// first replace <br /> with \n
|
||||||
|
$html = preg_replace('/\<(\s*)?br(\s*)?\/?(\s*)?\>/i', "\n", $html);
|
||||||
|
// then, unless explicitly avoided, remove excessive whitespace
|
||||||
if (!$save_whitespace) {
|
if (!$save_whitespace) {
|
||||||
$html = preg_replace('/\s+/', ' ', $html);
|
$html = preg_replace('/\s+/', ' ', $html);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user