Merge pull request #3222 from Hypolite/issue/#3220

Diaspora: Normalize line endings instead of adding <br> before Markdown()
2022.09-rc
Tobias Diekershoff 2017-03-12 15:35:42 +01:00 zatwierdzone przez GitHub
commit e29d7f19d1
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -39,9 +39,9 @@ function diaspora2bb($s) {
$s = html_entity_decode($s, ENT_COMPAT, 'UTF-8');
// Handles single newlines
$s = str_replace("\r", '<br>', $s);
$s = str_replace("\r\n", "\n", $s);
$s = str_replace("\n", " \n", $s);
$s = str_replace("\r", " \n", $s);
// Replace lonely stars in lines not starting with it with literal stars
$s = preg_replace('/^([^\*]+)\*([^\*]*)$/im', '$1\*$2', $s);