File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
ui/src/components/ai-chat/component/operation-button Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -152,12 +152,22 @@ function markdownToPlainText(md: string) {
152152 )
153153}
154154
155+ function removeFormRander(text : string ) {
156+ return text
157+ .replace (' 你好,请先填写下面表单内容:' , ' ' )
158+ .replace (/ <formrander>[\s\S ] *? <\/ formrander>/ , ' ' )
159+ .replace (' 填写后请点击【提交】按钮进行提交。' , ' ' )
160+ .trim ()
161+ }
162+
155163const playAnswerText = (text : string ) => {
156164 if (! text ) {
157165 text = ' 抱歉,没有查找到相关内容,请重新描述您的问题或提供更多信息。'
158166 }
159167 // text 处理成纯文本
160168 text = markdownToPlainText (text )
169+ // 移除表单渲染器
170+ text = removeFormRander (text )
161171 audioPlayerStatus .value = true
162172 if (props .tts_type === ' BROWSER' ) {
163173 if (text !== utterance .value ?.text ) {
Original file line number Diff line number Diff line change @@ -131,12 +131,23 @@ function markdownToPlainText(md: string) {
131131 )
132132}
133133
134+ function removeFormRander(text : string ) {
135+ return text
136+ .replace (' 你好,请先填写下面表单内容:' , ' ' )
137+ .replace (/ <formrander>[\s\S ] *? <\/ formrander>/ , ' ' )
138+ .replace (' 填写后请点击【提交】按钮进行提交。' , ' ' )
139+ .trim ()
140+ }
141+
142+
134143const playAnswerText = (text : string ) => {
135144 if (! text ) {
136145 text = ' 抱歉,没有查找到相关内容,请重新描述您的问题或提供更多信息。'
137146 }
138147 // text 处理成纯文本
139148 text = markdownToPlainText (text )
149+ // 移除表单渲染器
150+ text = removeFormRander (text )
140151 audioPlayerStatus .value = true
141152 if (props .tts_type === ' BROWSER' ) {
142153 if (text !== utterance .value ?.text ) {
You can’t perform that action at this time.
0 commit comments