提交 f1a325db 编写于 作者: 江子健 提交者: Huan (李卓桓)

fix: Message.mention() (#1661)

上级 5abfc704
......@@ -229,6 +229,8 @@ export function qrCodeForChatie (): FileBox {
// http://jkorpela.fi/chars/spaces.html
// String.fromCharCode(8197)
export const FOUR_PER_EM_SPACE = String.fromCharCode(0x2005)
// mobile: \u2005, PC、mac: \u0020
export const AT_SEPRATOR_REGEX = /[\u2005\u0020]/
export function qrcodeValueToImageUrl (qrcodeValue: string): string {
return [
......
......@@ -33,7 +33,7 @@ import {
Accessory,
} from '../accessory'
import {
FOUR_PER_EM_SPACE,
AT_SEPRATOR_REGEX,
log,
Raven,
} from '../config'
......@@ -599,7 +599,7 @@ export class Message extends Accessory implements Sayable {
// define magic code `8197` to identify @xxx
// const AT_SEPRATOR = String.fromCharCode(8197)
const AT_SEPRATOR = FOUR_PER_EM_SPACE
const AT_SEPRATOR = AT_SEPRATOR_REGEX
const atList = this.text().split(AT_SEPRATOR)
// console.log('atList: ', atList)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册