Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 3c7b8dd

Browse files
committed
remove newline characters from editorstate html
1 parent 2feef35 commit 3c7b8dd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ class RNDraftView extends Component {
5252
const { blockType, styles, editorState, isMounted } = JSON.parse(data);
5353
onStyleChanged(styles ? styles.split(",") : []);
5454
if (blockType) onBlockTypeChanged(blockType);
55-
if (editorState) this.setState({ editorState });
55+
if (editorState)
56+
this.setState({ editorState: editorState.replace(/(\r\n|\n|\r)/gm, "") });
5657
if (isMounted) this.widgetMounted();
5758
};
5859

0 commit comments

Comments
 (0)