From: Mischa POSLAWSKY
Date: Sat, 15 May 2021 20:18:54 +0000 (+0200)
Subject: widget/reply: emphasis formatting over sentences
X-Git-Tag: v5.3~4
X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/cc9044a1aa3f79cda743040573d49bc71fb7805f?hp=f8527c143033f51fecd929789ef7ad6589c8c2b4
widget/reply: emphasis formatting over sentences
Fix boundaries and contents besides simple words.
---
diff --git a/upload.inc.php b/upload.inc.php
index 86af604..0ee432b 100644
--- a/upload.inc.php
+++ b/upload.inc.php
@@ -58,8 +58,8 @@ function messagehtml($input)
"/\r\n?/" => "\n", # unix newlines
"/ +\n/" => "
", # trailing spaces for hard line break
"/\n/" => "
\n", # newlines start paragraphs
- '/\b_(\w+)_\b/' => '$1', # italic
- '/\b\*(\w+)\*\b/' => '$1', # bold
+ '/_(? '$1', # italic
+ '/\*(? '$1', # bold
];
$html = preg_replace(array_keys($markup), array_values($markup), htmlspecialchars($input));
return "
$html
";