From: Mischa POSLAWSKY
Date: Fri, 14 May 2021 14:18:09 +0000 (+0200)
Subject: widget/reply: paragraph breaks on input lines unless trailing spaces
X-Git-Tag: v5.3~8
X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/df953b78c421e60f37832fa4581e5d3ca2a1bd8d
widget/reply: paragraph breaks on input lines unless trailing spaces
Expect stories not poems, so hard line breaks should rarely be intended.
Exceptions are possible using Markdown syntax of trailing whitespace.
---
diff --git a/upload.inc.php b/upload.inc.php
index e70f573..7810ff6 100644
--- a/upload.inc.php
+++ b/upload.inc.php
@@ -52,8 +52,8 @@ function messagehtml($input)
return $input; # allow html input as is if privileged
}
$html = preg_replace(
- ["/\r?\n/", "'(?:
\n?){2}'"],
- ["
\n", "
\n\n"],
+ ["/\r\n?/", "/ +\n/", "/\n/"],
+ ["\n", "
", "
\n"],
htmlspecialchars($input)
);
return "
$html
";