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:
parent
b952b22735
commit
3e285a690a
2 changed files with 29 additions and 17 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue