1.3.8
- 修复某些命令标签报错
以下为命令标签匹配代码的逻辑
const regexeStrArr = [
"```j(?:ava)?s(?:cript)?\\n([\\s\\S]+?)\\n```",
"<code>([\\s\\S]+?)<\\/code>",
"\\$\\{([\\s\\S]+?)\\}\\$",
]
let rawResStringArr: [string, string][] = []
for (let regexStr of regexeStrArr) {
for (let rawString of text.match(new RegExp(regexStr, "g"))! || []) {
let codeString = rawString.match(new RegExp(regexStr))![1]
try {
ztoolkit.log(codeString)
let resString = await window.eval(`${codeString}`)
rawResStringArr.push([rawString, String(resString)])
} catch (e: any) {
Meet.Global.popupWin?.createLine({ text: e.message, type: "fail" })
window.alert(e.message)
}
}
}