strip mentioned name from the forwarded preview

This commit is contained in:
or-else
2021-11-24 18:55:44 -08:00
parent 081eb8723d
commit 3feca32d13
5 changed files with 35 additions and 6 deletions
+15 -1
View File
@@ -606,7 +606,17 @@ function fullFormatter(style, data, values, key) {
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(el, attr, values);
}
;
function extractMentionSymbol(content) {
if (Array.isArray(content) && content.length > 0) {
content = extractMentionSymbol(content[0]);
} else if (typeof content == 'string' && content.startsWith('➦')) {
content = ['➦'];
}
return content;
}
function previewFormatter(style, data, values, key) {
if (!style) {
return values;
@@ -632,7 +642,11 @@ function previewFormatter(style, data, values, key) {
break;
case 'LN':
el = 'span';
break;
case 'MN':
values = extractMentionSymbol(values);
el = 'span';
break;
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long