|
@@ -65,17 +65,18 @@ function ZRichTexts(
|
|
|
// 不是按章节发布,检查第一个富文本
|
|
|
if (!isSection) {
|
|
|
const txt = sectionArr[0].txt.toHTML()
|
|
|
- if (txt.replaceAll('<p>', '').replaceAll('</p>', '').replaceAll(' ', '') === '') flag = true
|
|
|
|
|
|
- if (txt.split('></p>').length - 1 === 1) flag = true
|
|
|
+ const txtRes = txt.replaceAll(' ', '').replaceAll('</p><p>', '')
|
|
|
+
|
|
|
+ if (txtRes.split('></p>').length - 1 === 1 || txtRes === '') flag = true
|
|
|
} else {
|
|
|
// 按章节发布 检查 所有的 标题 和富文本
|
|
|
sectionArr.forEach((v, i) => {
|
|
|
if (!v.name) flag = true
|
|
|
const txt: string = v.txt.toHTML()
|
|
|
- if (txt.replaceAll('<p>', '').replaceAll('</p>', '').replaceAll(' ', '') === '') flag = true
|
|
|
|
|
|
- if (txt.split('></p>').length - 1 === 1) flag = true
|
|
|
+ const txtRes = txt.replaceAll(' ', '').replaceAll('</p><p>', '')
|
|
|
+ if (txtRes.split('></p>').length - 1 === 1 || txtRes === '') flag = true
|
|
|
})
|
|
|
}
|
|
|
|