Skip to content

Commit

Permalink
fix: occurs script error when pasting code block in wysiwyg (fix #693,
Browse files Browse the repository at this point in the history
  • Loading branch information
seonim-ryu authored Jun 11, 2020
1 parent 7c00b60 commit 22a1744
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/editor/src/js/wwClipboardManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ class WwClipboardManager {
pasteData.fragment = document.createDocumentFragment();

toArray(clipboardContainer.childNodes).forEach(element => {
if (domUtils.getNodeName(element) === 'DIV') {
this._replaceNewLineToBr(element);
}
pasteData.fragment.appendChild(element);
});

Expand Down Expand Up @@ -283,7 +286,6 @@ class WwClipboardManager {
this._preProcessPtag(clipboardContainer);
}

this._replaceNewLineToBr(clipboardContainer);
this._removeEmptyFontElement(clipboardContainer);

this._pch.preparePaste(clipboardContainer);
Expand Down

0 comments on commit 22a1744

Please sign in to comment.