diff --git a/resources/assets/js/pages/manage/components/DialogView/index.vue b/resources/assets/js/pages/manage/components/DialogView/index.vue index 6e8e3f1fd..ff5128c57 100644 --- a/resources/assets/js/pages/manage/components/DialogView/index.vue +++ b/resources/assets/js/pages/manage/components/DialogView/index.vue @@ -58,10 +58,10 @@
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/, + twoEmoji: /^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/, + oneEmoji: /^\s*
\s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/, + emojiRange: /^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/
+});
+
export default {
name: "DialogView",
components: {
@@ -332,8 +341,8 @@ export default {
}
if (reply_id === 0 && $A.arrayLength(emoji) === 0) {
if (type === 'text') {
- if (/^]*?>$/.test(msg.text)
- || /^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(msg.text)) {
+ if (REGEX_CACHE.emoticon.test(msg.text)
+ || REGEX_CACHE.emojiRange.test(msg.text)) {
classArray.push('transparent')
}
}
@@ -352,20 +361,25 @@ export default {
contentClass() {
const {type, msg} = this.msgData;
const classArray = [];
+
if (this.operateEnter || this.pointerMouse) {
classArray.push('user-select-auto')
}
- if (type === 'text') {
- if (/^]*?>$/.test(msg.text)) {
+
+ if (type === 'text' && msg?.text) {
+ const text = msg.text;
+
+ if (REGEX_CACHE.emoticon.test(text)) {
classArray.push('an-emoticon')
- } else if (/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(msg.text)) { + } else if (REGEX_CACHE.threeEmoji.test(text)) { classArray.push('three-emoji') - } else if (/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(msg.text)) { + } else if (REGEX_CACHE.twoEmoji.test(text)) { classArray.push('two-emoji') - } else if (/^\s*
\s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(msg.text)) { + } else if (REGEX_CACHE.oneEmoji.test(text)) { classArray.push('an-emoji') } } + return classArray; } },