Properly handle spaces in user ids (fixes #1515)

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-02-10 14:04:20 +01:00
parent 07fd562a55
commit e6de5fe3a9
4 changed files with 18 additions and 4 deletions

View File

@@ -133,7 +133,11 @@ export default {
// adding it.
// FIXME user names can contain spaces, in that case they need to be wrapped @"user name" [a-zA-Z0-9\ _\.@\-']+
const mentionValue = mention.firstElementChild.attributes['data-mention-id'].value
mention.replaceWith(' @' + mentionValue + ' ')
if (mentionValue.indexOf(' ') !== -1) {
mention.replaceWith(' @"' + mentionValue + '" ')
} else {
mention.replaceWith(' @' + mentionValue + ' ')
}
})
return rawToParsed(node.innerHTML)