Remaining inline options in common chat systems.
"/\n/" => "</p>\n<p>", # newlines start paragraphs
'/_(?<!\w_)(.+?)_(?!\w)/' => '<em>$1</em>', # italic
'/\*(?<!\w\*)(.+?)\*(?!\w)/' => '<strong>$1</strong>', # bold
+ '/~(?<!\w~)(.+?)~(?!\w)/' => '<s>$1</s>', # stricken
+ '/`(?<!\w`)(.+?)`(?!\w)/' => '<code>$1</code>', # monospace
];
$html = preg_replace(array_keys($markup), array_values($markup), htmlspecialchars($input));
return "<p>$html</p>";