Fixs edge case where single stars on succeeding lines are wrongly turned into multi-line <em>

pull/2990/head
Hypolite Petovan 2016-12-05 22:47:52 -05:00
rodzic 60b9203dd5
commit d0cb8cdccf
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -22,6 +22,9 @@ function diaspora2bb($s) {
$s = str_replace("\n", " \n", $s);
// Replace lonely stars in lines not starting with it with literal stars
$s = preg_replace('/^([^\*]+)\*([^\*]*)$/im', '$1\*$2', $s);
// The parser cannot handle paragraphs correctly
$s = str_replace(array('</p>', '<p>', '<p dir="ltr">'), array('<br>', '<br>', '<br>'), $s);