Skip to content

Commit

Permalink
fix multi node append
Browse files Browse the repository at this point in the history
  • Loading branch information
neSpecc committed Mar 30, 2024
1 parent 72e6c29 commit 31eb426
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dist/paragraph.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".ce-paragraph{line-height:1.6em;outline:none}.ce-paragraph[data-placeholder]:empty:before{content:attr(data-placeholder);color:#707684;font-weight:400;opacity:0}.codex-editor--empty .ce-block:first-child .ce-paragraph[data-placeholder]:empty:before{opacity:1}.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph[data-placeholder]:empty:before,.codex-editor--empty .ce-block:first-child .ce-paragraph[data-placeholder]:empty:focus:before{opacity:0}.ce-paragraph p:first-of-type{margin-top:0}.ce-paragraph p:last-of-type{margin-bottom:0}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
const s = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8 9V7.2C8 7.08954 8.08954 7 8.2 7L12 7M16 9V7.2C16 7.08954 15.9105 7 15.8 7L12 7M12 7L12 17M12 17H10M12 17H14"/></svg>';
function l(r) {
function o(r) {
const t = document.createElement("div");
t.innerHTML = r.trim();
const e = document.createDocumentFragment();
return e.appendChild(...Array.from(t.childNodes)), e;
return e.append(...Array.from(t.childNodes)), e;
}
/**
* Base Paragraph Block for the Editor.js.
Expand Down Expand Up @@ -78,7 +78,7 @@ class n {
*/
merge(t) {
this._data.text += t.text;
const e = l(t.text);
const e = o(t.text);
this._element.appendChild(e), this._element.normalize();
}
/**
Expand Down
2 changes: 1 addition & 1 deletion dist/paragraph.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/utils/makeFragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function makeFragment(htmlString) {

const fragment = document.createDocumentFragment();

fragment.appendChild(...Array.from(tempDiv.childNodes));
fragment.append(...Array.from(tempDiv.childNodes));

return fragment;
}

0 comments on commit 31eb426

Please sign in to comment.