diff --git a/magic-editor/src/console/src/components/layout/magic-search.vue b/magic-editor/src/console/src/components/layout/magic-search.vue index 80bd2bd4..ae6aef64 100644 --- a/magic-editor/src/console/src/components/layout/magic-search.vue +++ b/magic-editor/src/console/src/components/layout/magic-search.vue @@ -128,7 +128,7 @@ export default { this.searchList.forEach(async item => { // 增加关键字高亮 //item.text = item.text.replace(new RegExp(text, 'g'), `${text}`) - item.text = (await this.getHighlight(item.text)).replace(new RegExp(text, 'g'), `${text}`) + item.text = (await this.getHighlight(item.text)).replaceAll(/(?<=>)(.|\s)*?(?=<\/?\w+[^<]*>)/g, it=> it.replaceAll(text, `${text}`)) if (item.type === 1) { item.cache = $parent.apiList.getItemById(item.id) } else if (item.type === 2) {