@flozy/editor 6.0.7 → 6.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -175,7 +175,7 @@ const deserialize = el => {
175
175
  if (el.nodeType === 3) {
176
176
  // if there is any line-breaks
177
177
  const match = /\r|\n/.exec(el.textContent);
178
- const text = el.textContent.replace(/\r|\n/g, "").trim();
178
+ const text = el.textContent?.trim()?.length === 0 ? el.textContent.replace(/\r|\n/g, "").trim() : el.textContent;
179
179
  return match && !text ? null : {
180
180
  text,
181
181
  ...getInlineTextStyles(el.parentNode)
@@ -30,6 +30,8 @@ const parseCopiedHTML = html => {
30
30
 
31
31
  // claude.ai, copy list inbetween, some li tags are not wrapped with ul or ol
32
32
  parsed.querySelectorAll("li").forEach(li => {
33
+ li.innerHTML = li.innerHTML.replace(/^\n+|\n+$/g, ""); // Removes leading and trailing newlines
34
+
33
35
  // Check if the parent of <li> is not a <ul> or <ol>
34
36
  if (!li.parentElement || li.parentElement.tagName !== "UL" && li.parentElement.tagName !== "OL") {
35
37
  // Create a <ul> element
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "6.0.7",
3
+ "version": "6.0.9",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"