diff --git a/ui/src/components/ai-chat/component/prologue-content/index.vue b/ui/src/components/ai-chat/component/prologue-content/index.vue index 2fa247d8e..77969ae49 100644 --- a/ui/src/components/ai-chat/component/prologue-content/index.vue +++ b/ui/src/components/ai-chat/component/prologue-content/index.vue @@ -32,7 +32,26 @@ const toQuickQuestion = (match: string, offset: number, input: string) => { } const prologue = computed(() => { const temp = props.available ? props.application?.prologue : t('chat.tip.prologueMessage') - return temp?.replace(/-\s.+/g, toQuickQuestion) + if (temp) { + const tag_list = [ + /[\d\D]*?<\/html_rander>/g, + /[\d\D]*?<\/echarts_rander>/g, + /[\d\D]*?<\/quick_question>/g, + /[\d\D]*?<\/form_rander>/g + ] + let _temp = temp + for (const index in tag_list) { + _temp = _temp.replaceAll(tag_list[index], '') + } + const quick_question_list = _temp.match(/-\s.+/g) + let result = temp + for (const index in quick_question_list) { + const quick_question = quick_question_list[index] + result = temp.replace(quick_question, toQuickQuestion) + } + return result + } + return '' })