Skip to content

Commit

Permalink
可编辑div空格编码特殊处理&&变量编辑页联想不到自定义节点问题修复 (#7164)
Browse files Browse the repository at this point in the history
* bugfix: 可编辑div空格编码特殊处理&&变量编辑页联想不到自定义节点问题修复

* minor: 正则优化
  • Loading branch information
ywywZhou authored Nov 10, 2023
1 parent c37e3aa commit a51323d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,10 @@
return item.type === 'button' ? item.value : item.textContent
}).join('')
}
// 用户手动输入 渲染时需要切开展示
domValue = domValue.replace(/&nbsp;/g, '<span>&</span><span>nbsp</span><span>;</span>')
// 用户手动输入的空格编码渲染时需要切开展示
domValue = domValue.replace(/&(nbsp|ensp|emsp|thinsp|zwnj|zwj);/g, ($0, $1) => {
return `<span>&</span><span>${$1}</span><span>;</span>`
})
// 初始化时是通过innerText进行复制的,如果有多个连续空格则只会显示一个,所以需手动将转为&nbsp;
domValue = domValue.replace(/( )/g, '&nbsp;')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,10 @@
return item.type === 'button' ? item.value : item.textContent
}).join('')
}
// 用户手动输入&nbsp;渲染时需要切开展示
domValue = domValue.replace(/&nbsp;/g, '<span>&</span><span>nbsp</span><span>;</span>')
// 用户手动输入的空格编码渲染时需要切开展示
domValue = domValue.replace(/&(nbsp|ensp|emsp|thinsp|zwnj|zwj);/g, ($0, $1) => {
return `<span>&</span><span>${$1}</span><span>;</span>`
})
// 初始化时是通过innerText进行复制的,如果有多个连续空格则只会显示一个,所以需手动将转为&nbsp;
domValue = domValue.replace(/( )/g, '&nbsp;')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
<template v-if="!atomConfigLoading && renderConfig.length">
<RenderForm
ref="renderForm"
:constants="constants"
:scheme="renderConfig"
:form-option="renderOption"
v-model="renderData">
Expand Down

0 comments on commit a51323d

Please sign in to comment.