From 13b96b135bdb19982bc991dce8ba7aad5e10f680 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Thu, 31 Oct 2024 17:22:47 +0800 Subject: [PATCH] build: v1.2.5 release (^.^)YYa!! --- changes.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/util/htmlUtil.ts | 7 ++++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/changes.md b/changes.md index 39bd703..9bdaea9 100644 --- a/changes.md +++ b/changes.md @@ -1,7 +1,7 @@ # AiEditor ChangeLog -## v1.2.4 20241031: +## v1.2.5 20241031: - fix: CodeBlock Extensions error sometime - fix: optimize paste extension and fix paste with data-pm-slice is error - fix: fix tab key conflict with ordered lists diff --git a/package-lock.json b/package-lock.json index 4d638bc..8d582f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "aieditor", - "version": "1.2.4", + "version": "1.2.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "aieditor", - "version": "1.2.4", + "version": "1.2.5", "license": "LGPL", "dependencies": { "@tiptap/core": "^2.9.1", diff --git a/package.json b/package.json index 6bba9a7..9e24eb8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "aieditor", "author": "yangfuhai", - "version": "1.2.4", + "version": "1.2.5", "type": "module", "keywords": [ "editor", diff --git a/src/util/htmlUtil.ts b/src/util/htmlUtil.ts index 8a57ef3..262cb23 100644 --- a/src/util/htmlUtil.ts +++ b/src/util/htmlUtil.ts @@ -135,13 +135,14 @@ export const clearDataMpSlice = (html: string) => { const parser = new DOMParser(); const doc = parser.parseFromString(html, 'text/html'); const fragment = document.createDocumentFragment(); - for (let child of doc.body.children) { + const children = doc.body.children; + for (let child of children) { if (child.hasAttribute("data-pm-slice")) { child.childNodes.forEach((child) => { - fragment.appendChild(child); + fragment.appendChild(child.cloneNode(true)); }) } else { - fragment.appendChild(child); + fragment.appendChild(child.cloneNode(true)); } } const tempDiv = document.createElement('div');