git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72aa68c
)
widget/reply: paragraph breaks on input lines unless trailing spaces
author
Mischa POSLAWSKY
<perl@shiar.org>
Fri, 14 May 2021 14:18:09 +0000
(16:18 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 17 May 2021 18:53:38 +0000
(20:53 +0200)
Expect stories not poems, so hard line breaks should rarely be intended.
Exceptions are possible using Markdown syntax of trailing whitespace.
upload.inc.php
patch
|
blob
|
history
diff --git
a/upload.inc.php
b/upload.inc.php
index e70f5738a3bfacafa1a4013b42f5905010c7d676..7810ff6e613da2e065264ae954c291a08b72f383 100644
(file)
--- 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/", "'(?:<br />\n?){2}'
"],
- ["
<br />\n", "</p>\n
\n<p>"],
+ ["/\r
\n?/", "/ +\n/", "/\n/
"],
+ ["
\n", "<br />", "</p>
\n<p>"],
htmlspecialchars($input)
);
return "<p>$html</p>";