From 76957865bb3a147a7b419876001e9a55f42768c3 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 31 Mar 2019 14:39:55 -0700 Subject: [PATCH] Ensure normalize on load, imported documents arent safe --- app/scenes/Document/components/Editor.js | 7 ++++--- package.json | 2 +- yarn.lock | 14 +++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/scenes/Document/components/Editor.js b/app/scenes/Document/components/Editor.js index 0f9b02198..ef8417895 100644 --- a/app/scenes/Document/components/Editor.js +++ b/app/scenes/Document/components/Editor.js @@ -6,6 +6,8 @@ import Placeholder from 'rich-markdown-editor/lib/components/Placeholder'; import ClickablePadding from 'components/ClickablePadding'; import plugins from './plugins'; +const defaultOptions = { normalize: true }; + type Props = { defaultValue?: string, readOnly?: boolean, @@ -29,15 +31,14 @@ class DocumentEditor extends React.Component { }; render() { - const { readOnly, defaultValue } = this.props; + const { readOnly } = this.props; return ( (this.editor = ref)} plugins={plugins} - options={{ normalize: !defaultValue }} - defaultValue={defaultValue} + options={defaultOptions} {...this.props} />