From df953b78c421e60f37832fa4581e5d3ca2a1bd8d Mon Sep 17 00:00:00 2001
From: Mischa POSLAWSKY
Date: Fri, 14 May 2021 16:18:09 +0200
Subject: [PATCH 1/1] 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.
---
upload.inc.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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
";
--
2.30.0