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; } }, 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 ( -
+
-
+
); }