Ensure normalize on load, imported documents arent safe

This commit is contained in:
Tom Moor
2019-03-31 14:39:55 -07:00
parent 1883e77d5c
commit 76957865bb
3 changed files with 12 additions and 11 deletions

View File

@@ -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<Props> {
};
render() {
const { readOnly, defaultValue } = this.props;
const { readOnly } = this.props;
return (
<React.Fragment>
<StyledEditor
ref={ref => (this.editor = ref)}
plugins={plugins}
options={{ normalize: !defaultValue }}
defaultValue={defaultValue}
options={defaultOptions}
{...this.props}
/>
<ClickablePadding

View File

@@ -143,7 +143,7 @@
"react-waypoint": "^7.3.1",
"redis": "^2.6.2",
"redis-lock": "^0.1.0",
"rich-markdown-editor": "^9.1.0",
"rich-markdown-editor": "^9.1.1",
"safestart": "1.1.0",
"sequelize": "4.28.6",
"sequelize-cli": "^5.4.0",

View File

@@ -7735,9 +7735,9 @@ retry-axios@0.3.2, retry-axios@^0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/retry-axios/-/retry-axios-0.3.2.tgz#5757c80f585b4cc4c4986aa2ffd47a60c6d35e13"
rich-markdown-editor@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/rich-markdown-editor/-/rich-markdown-editor-9.1.0.tgz#d149eda8aa416c06eb1c2b3dfc474f9cd0b7a632"
rich-markdown-editor@^9.1.1:
version "9.1.1"
resolved "https://registry.yarnpkg.com/rich-markdown-editor/-/rich-markdown-editor-9.1.1.tgz#3fd0f2b2ed8e3e2690d29f7cefefa4bdf8fc7bef"
dependencies:
"@tommoor/slate-edit-list" "0.19.0-0"
"@wikifactory/slate-edit-blockquote" "^0.7.1"
@@ -7763,7 +7763,7 @@ rich-markdown-editor@^9.1.0:
slate "^0.44.10"
slate-collapse-on-escape "^0.8.1"
slate-drop-or-paste-images "^0.9.1"
slate-md-serializer "^5.3.0"
slate-md-serializer "^5.3.1"
slate-paste-linkify "^0.7.0"
slate-react "^0.21.15"
slate-schema-violations "^0.1.39"
@@ -8088,9 +8088,9 @@ slate-hotkeys@^0.2.8:
is-hotkey "0.1.4"
slate-dev-environment "^0.2.1"
slate-md-serializer@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/slate-md-serializer/-/slate-md-serializer-5.3.0.tgz#481c1cafe75151faee264803c30bf3dd5f4ed2ac"
slate-md-serializer@^5.3.1:
version "5.3.1"
resolved "https://registry.yarnpkg.com/slate-md-serializer/-/slate-md-serializer-5.3.1.tgz#999dfb9dafe71d2f96019d9d95d4aac24bd493de"
dependencies:
hashtag-regex "^2.0.0"