widget/reply: paragraph breaks on input lines unless trailing spaces
[minimedit.git] / upload.inc.php
index e70f5738a3bfacafa1a4013b42f5905010c7d676..7810ff6e613da2e065264ae954c291a08b72f383 100644 (file)
@@ -52,8 +52,8 @@ function messagehtml($input)
                return $input;  # allow html input as is if privileged
        }
        $html = preg_replace(
-               ["/\r?\n/", "'(?:<br />\n?){2}'"],
-               ["<br />\n", "</p>\n\n<p>"],
+               ["/\r\n?/", "/  +\n/", "/\n/"],
+               ["\n",      "<br />",  "</p>\n<p>"],
                htmlspecialchars($input)
        );
        return "<p>$html</p>";