Fix link generation when user mention is followed by a punctuation mark

This commit is contained in:
Frederic Guillot
2016-11-30 18:26:40 -05:00
parent 8588a8bda9
commit 700e226ba8
3 changed files with 10 additions and 1 deletions

View File

@@ -86,7 +86,7 @@ class Markdown extends Parsedown
*/
protected function inlineUserLink(array $Excerpt)
{
if (! $this->isPublicLink && preg_match('/^@([^\s]+)/', $Excerpt['text'], $matches)) {
if (! $this->isPublicLink && preg_match('/^@([^\s,!.:?]+)/', $Excerpt['text'], $matches)) {
$user_id = $this->container['userModel']->getIdByUsername($matches[1]);
if (! empty($user_id)) {