Skip to content

Commit

Permalink
fix(editors): Map only root html elements
Browse files Browse the repository at this point in the history
Reviewed-by: @MIGUELez11
Refs: #113
  • Loading branch information
Volcanos authored Jan 30, 2024
1 parent 547f37e commit 6a3f9da
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/editors/src/form/TextEditor/TextEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ const TextEditor = ({
const getEditorJson = () => {
const originalHTML = document.getElementsByClassName('ProseMirror')[0];
if (!originalHTML) return {};
const htmlContent = [...originalHTML.getElementsByTagName('*')].filter(
(element) => element.tagName !== 'BR',
);
const htmlContent = [...originalHTML.childNodes].filter((element) => element.tagName !== 'BR');
const originalJSON = editor.getJSON();

return {
Expand Down

0 comments on commit 6a3f9da

Please sign in to comment.