File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
ui/src/components/ai-chat/component/operation-button Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -155,8 +155,8 @@ function markdownToPlainText(md: string) {
155155function removeFormRander(text : string ) {
156156 return text
157157 .replace (' 你好,请先填写下面表单内容:' , ' ' )
158- .replace (/ <formrander> [ \s\S ] *? < \/ formrander> / , ' ' )
159- .replace (/ <form_rander> [ \s\S ] *? <\/ form_rander> / , ' ' )
158+ .replace (' 请先填写以下表单并点击提交按钮 ' , ' ' )
159+ .replace (/ <[ ^ >] + > . *? <\/ [ ^ >] + > / gs , ' ' )
160160 .replace (' 填写后请点击【提交】按钮进行提交。' , ' ' )
161161 .trim ()
162162}
@@ -169,6 +169,7 @@ const playAnswerText = (text: string) => {
169169 text = markdownToPlainText (text )
170170 // 移除表单渲染器
171171 text = removeFormRander (text )
172+ // console.log(text)
172173 audioPlayerStatus .value = true
173174 if (props .tts_type === ' BROWSER' ) {
174175 if (text !== utterance .value ?.text ) {
Original file line number Diff line number Diff line change @@ -134,8 +134,8 @@ function markdownToPlainText(md: string) {
134134function removeFormRander(text : string ) {
135135 return text
136136 .replace (' 你好,请先填写下面表单内容:' , ' ' )
137- .replace (/ <formrander> [ \s\S ] *? < \/ formrander> / , ' ' )
138- .replace (/ <form_rander> [ \s\S ] *? <\/ form_rander> / , ' ' )
137+ .replace (' 请先填写以下表单并点击提交按钮 ' , ' ' )
138+ .replace (/ <[ ^ >] + > . *? <\/ [ ^ >] + > / gs , ' ' )
139139 .replace (' 填写后请点击【提交】按钮进行提交。' , ' ' )
140140 .trim ()
141141}
@@ -149,6 +149,7 @@ const playAnswerText = (text: string) => {
149149 text = markdownToPlainText (text )
150150 // 移除表单渲染器
151151 text = removeFormRander (text )
152+ console .log (text )
152153 audioPlayerStatus .value = true
153154 if (props .tts_type === ' BROWSER' ) {
154155 if (text !== utterance .value ?.text ) {
You can’t perform that action at this time.
0 commit comments