You've already forked SmartisanNote.Remake
"修复:便签内容为空检查逻辑,支持纯图片便签"
This commit is contained in:
@@ -214,6 +214,10 @@ const handleSave = async () => {
|
|||||||
const isContentEmpty = content => {
|
const isContentEmpty = content => {
|
||||||
if (!content) return true
|
if (!content) return true
|
||||||
|
|
||||||
|
// 检查是否包含图片元素
|
||||||
|
const hasImages = /<img[^>]*>|<div[^>]*class="[^"]*editor-image[^"]*"[^>]*>/.test(content)
|
||||||
|
if (hasImages) return false
|
||||||
|
|
||||||
// 移除HTML标签和空白字符后检查是否为空
|
// 移除HTML标签和空白字符后检查是否为空
|
||||||
const plainText = content.replace(/<[^>]*>/g, '').trim()
|
const plainText = content.replace(/<[^>]*>/g, '').trim()
|
||||||
if (plainText === '') return true
|
if (plainText === '') return true
|
||||||
|
|||||||
Reference in New Issue
Block a user