X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fhtml2bbcode.php;h=8025c336bc9ca5b3aa7cf7ce6044af7bd90108e7;hb=1248a561e13ebd0a612b7e6b0630c1aa89f0556e;hp=688c0145266a78b67ef8ef47f077d206574b8664;hpb=31d447126aefbe1bdb14ed5a4a6b7d84845e9f29;p=friendica.git diff --git a/include/html2bbcode.php b/include/html2bbcode.php index 688c014526..8025c336bc 100644 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -7,47 +7,69 @@ function html2bbcode($s) { + + // only keep newlines from source that are within pre tags + + $s = stripnl_exceptinpre($s); + + // Tags to Find $htmltags = array( - '/\n/is', + '/\
(.*?)\<\/pre\>/is', + '/\/is', + '/\<\/p\>/is', '/\(.*?)\<\/b\>/is', '/\(.*?)\<\/i\>/is', '/\(.*?)\<\/u\>/is', '/\
(.*?)\<\/ul\>/is', '/\
- (.*?)\<\/li\>/is', + '/\
/is', + '/\
/is', + '/\
/is', + '/\
/is', '/\
/is', '/\
(.*?)\<\/div\>/is', '/\
/is', '/\(.*?)\<\/strong\>/is', - '/\(.*?)\<\/a\>/is', + '/\(.*?)\<\/a\>/is', '/\(.*?)\<\/code\>/is', '/\(.*?)\<\/span\>/is', + '/\(.*?)\<\/span\>/is', '/\
(.*?)\<\/blockquote\>/is', '/\