upd: collapse mentions if multiple are followed in a row

This commit is contained in:
Mar0xy 2023-11-28 03:01:37 +01:00
parent 13e8269993
commit bd470596cc
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
2 changed files with 50 additions and 2 deletions

View file

@ -82,7 +82,13 @@ export default function(props: MfmProps) {
res.push(t);
}
res.shift();
return res;
// Don't wrap whitespaces in a span
if (text === ' ') {
return res;
}
return h('span', res);
} else {
return [text.replace(/\n/g, ' ')];
}