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