Fixs edge case where single stars on succeeding lines are wrongly turned into multi-line <em>
This commit is contained in:
parent
60b9203dd5
commit
d0cb8cdccf
|
@ -22,6 +22,9 @@ function diaspora2bb($s) {
|
||||||
|
|
||||||
$s = str_replace("\n", " \n", $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
|
// The parser cannot handle paragraphs correctly
|
||||||
$s = str_replace(array('</p>', '<p>', '<p dir="ltr">'), array('<br>', '<br>', '<br>'), $s);
|
$s = str_replace(array('</p>', '<p>', '<p dir="ltr">'), array('<br>', '<br>', '<br>'), $s);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue