fix: 处理回复中的html标签和内容
This commit is contained in:
parent
ec27e57f2c
commit
2178a81c65
@ -155,8 +155,8 @@ function markdownToPlainText(md: string) {
|
|||||||
function removeFormRander(text: string) {
|
function removeFormRander(text: string) {
|
||||||
return text
|
return text
|
||||||
.replace('你好,请先填写下面表单内容:', '')
|
.replace('你好,请先填写下面表单内容:', '')
|
||||||
.replace(/<formrander>[\s\S]*?<\/formrander>/, '')
|
.replace('请先填写以下表单并点击提交按钮', '')
|
||||||
.replace(/<form_rander>[\s\S]*?<\/form_rander>/, '')
|
.replace(/<[^>]+>.*?<\/[^>]+>/gs, '')
|
||||||
.replace('填写后请点击【提交】按钮进行提交。', '')
|
.replace('填写后请点击【提交】按钮进行提交。', '')
|
||||||
.trim()
|
.trim()
|
||||||
}
|
}
|
||||||
@ -169,6 +169,7 @@ const playAnswerText = (text: string) => {
|
|||||||
text = markdownToPlainText(text)
|
text = markdownToPlainText(text)
|
||||||
// 移除表单渲染器
|
// 移除表单渲染器
|
||||||
text = removeFormRander(text)
|
text = removeFormRander(text)
|
||||||
|
// console.log(text)
|
||||||
audioPlayerStatus.value = true
|
audioPlayerStatus.value = true
|
||||||
if (props.tts_type === 'BROWSER') {
|
if (props.tts_type === 'BROWSER') {
|
||||||
if (text !== utterance.value?.text) {
|
if (text !== utterance.value?.text) {
|
||||||
|
|||||||
@ -134,8 +134,8 @@ function markdownToPlainText(md: string) {
|
|||||||
function removeFormRander(text: string) {
|
function removeFormRander(text: string) {
|
||||||
return text
|
return text
|
||||||
.replace('你好,请先填写下面表单内容:', '')
|
.replace('你好,请先填写下面表单内容:', '')
|
||||||
.replace(/<formrander>[\s\S]*?<\/formrander>/, '')
|
.replace('请先填写以下表单并点击提交按钮', '')
|
||||||
.replace(/<form_rander>[\s\S]*?<\/form_rander>/, '')
|
.replace(/<[^>]+>.*?<\/[^>]+>/gs, '')
|
||||||
.replace('填写后请点击【提交】按钮进行提交。', '')
|
.replace('填写后请点击【提交】按钮进行提交。', '')
|
||||||
.trim()
|
.trim()
|
||||||
}
|
}
|
||||||
@ -149,6 +149,7 @@ const playAnswerText = (text: string) => {
|
|||||||
text = markdownToPlainText(text)
|
text = markdownToPlainText(text)
|
||||||
// 移除表单渲染器
|
// 移除表单渲染器
|
||||||
text = removeFormRander(text)
|
text = removeFormRander(text)
|
||||||
|
console.log(text)
|
||||||
audioPlayerStatus.value = true
|
audioPlayerStatus.value = true
|
||||||
if (props.tts_type === 'BROWSER') {
|
if (props.tts_type === 'BROWSER') {
|
||||||
if (text !== utterance.value?.text) {
|
if (text !== utterance.value?.text) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user