From 0512c14e929e9daa6674ccfe20d1071994ae64a7 Mon Sep 17 00:00:00 2001 From: Cain Hall Date: Thu, 26 Jul 2018 09:21:48 +1000 Subject: [PATCH 1/2] html duplication bugfix --- src/react/Editor/convertFromHTML.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/react/Editor/convertFromHTML.js b/src/react/Editor/convertFromHTML.js index 22aa830c7..54493de02 100644 --- a/src/react/Editor/convertFromHTML.js +++ b/src/react/Editor/convertFromHTML.js @@ -45,7 +45,7 @@ export default (html, extraData) => isHTMLBlock || CODE_BLOCK_TAGS.includes(nodeName) ) { - return createEntity( + const codeBlock = createEntity( 'code-block', 'IMMUTABLE', { @@ -56,6 +56,9 @@ export default (html, extraData) => setReadOnly: extraData.setReadOnly, }, ); + /* eslint no-param-reassign: ["error", { "props": false }] */ + node.innerHTML = ''; + return codeBlock; } }, From aaa97499dbefda31353dde12ee47f705f5f2883d Mon Sep 17 00:00:00 2001 From: Cain Hall Date: Thu, 26 Jul 2018 11:50:30 +1000 Subject: [PATCH 2/2] remove codeblock containing div to react fragment --- src/react/Editor/convertToHTML.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/react/Editor/convertToHTML.js b/src/react/Editor/convertToHTML.js index e1a5a6467..005d97a42 100644 --- a/src/react/Editor/convertToHTML.js +++ b/src/react/Editor/convertToHTML.js @@ -19,12 +19,12 @@ export default contentState => if (type === 'code-block') { return ( -
+
-
+
); }