diff --git a/frontend/desktop/src/components/common/RenderForm/tags/TagInput.vue b/frontend/desktop/src/components/common/RenderForm/tags/TagInput.vue index 0ffe9cf059..0bcf4d691f 100644 --- a/frontend/desktop/src/components/common/RenderForm/tags/TagInput.vue +++ b/frontend/desktop/src/components/common/RenderForm/tags/TagInput.vue @@ -417,8 +417,10 @@ return item.type === 'button' ? item.value : item.textContent }).join('') } - // 用户手动输入 渲染时需要切开展示 - domValue = domValue.replace(/ /g, ' ') + // 用户手动输入的空格编码渲染时需要切开展示 + domValue = domValue.replace(/&(nbsp|ensp|emsp|thinsp|zwnj|zwj);/g, ($0, $1) => { + return `&${$1};` + }) // 初始化时是通过innerText进行复制的,如果有多个连续空格则只会显示一个,所以需手动将转为  domValue = domValue.replace(/( )/g, ' ') diff --git a/frontend/desktop/src/components/common/RenderForm/tags/TagTextarea.vue b/frontend/desktop/src/components/common/RenderForm/tags/TagTextarea.vue index ab7b8284b5..7df465f3c9 100644 --- a/frontend/desktop/src/components/common/RenderForm/tags/TagTextarea.vue +++ b/frontend/desktop/src/components/common/RenderForm/tags/TagTextarea.vue @@ -386,8 +386,10 @@ return item.type === 'button' ? item.value : item.textContent }).join('') } - // 用户手动输入 渲染时需要切开展示 - domValue = domValue.replace(/ /g, ' ') + // 用户手动输入的空格编码渲染时需要切开展示 + domValue = domValue.replace(/&(nbsp|ensp|emsp|thinsp|zwnj|zwj);/g, ($0, $1) => { + return `&${$1};` + }) // 初始化时是通过innerText进行复制的,如果有多个连续空格则只会显示一个,所以需手动将转为  domValue = domValue.replace(/( )/g, ' ') diff --git a/frontend/desktop/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables/VariableEdit.vue b/frontend/desktop/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables/VariableEdit.vue index 4d16eb1482..4e3d8d413a 100644 --- a/frontend/desktop/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables/VariableEdit.vue +++ b/frontend/desktop/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables/VariableEdit.vue @@ -202,6 +202,7 @@