-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown editor improvements #574
Conversation
erquhart
commented
Sep 1, 2017
•
edited
Loading
edited
- remove JIT serialization of markdown widget values
- debounce markdown widget change handler to improve performance
- fix broken editorial workflow (regression from Migrate rich text editor to Slate backed by Unified #254, missing import)
- close heading blocks on Enter
@@ -1,5 +1,6 @@ | |||
import uuid from 'uuid'; | |||
import { actions as notifActions } from 'redux-notifications'; | |||
import { serializeValues } from '../lib/serializeEntryValues'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this in #254.
7d8e5b9
to
efd0110
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to fix the two comments I noted, but other than that LGTM.
@@ -13,9 +13,8 @@ export default class RawEditor extends React.Component { | |||
* to plain text before Slate's Plain serializer can convert it to the | |||
* Slate AST. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is no longer accurate, since there's no stringification in this method anymore.
@@ -27,15 +26,16 @@ export default class RawEditor extends React.Component { | |||
this.setState({ editorState }); | |||
} | |||
|
|||
onChange = debounce(this.props.onChange, 250); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -27,15 +26,16 @@ export default class RawEditor extends React.Component { | |||
this.setState({ editorState }); | |||
} | |||
|
|||
onChange = debounce(this.props.onChange, 250); | |||
|
|||
/** | |||
* When the document value changes, serialize from Slate's AST back to plain | |||
* text (which is Markdown), and then deserialize from that to a Remark MDAST, | |||
* before passing up as the new value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is no longer accurate.
efd0110
to
a05f876
Compare
a05f876
to
75023d9
Compare