1
1
Fork 0

Fix Diaspora code blocks being mangled

- Remove whitespace removal code from `diaspora2bb()`
- Add code block skipping the HTML transforms removing whitespace in
`htm2bbcode()`
This commit is contained in:
Hypolite Petovan 2017-03-26 19:00:04 -04:00
commit 3e285a690a
2 changed files with 29 additions and 17 deletions

View file

@ -59,15 +59,6 @@ function diaspora2bb($s) {
$s = str_replace('#', '#', $s);
$search = array(" \n", "\n ");
$replace = array("\n", "\n");
do {
$oldtext = $s;
$s = str_replace($search, $replace, $s);
} while ($oldtext != $s);
$s = str_replace("\n\n", '<br>', $s);
$s = html2bbcode($s);
// protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands