pre-process visual editor pastes w/ unified

This commit is contained in:
Shawn Erquhart 2017-06-29 17:56:20 -04:00
parent 5a664f8be1
commit a8fe57e5d6

View File

@ -270,7 +270,9 @@ export default class Editor extends Component {
if (data.type !== 'html' || data.isShift) {
return;
}
const fragment = serializer.deserialize(data.html).document;
const markdown = htmlToMarkdown(data.html);
const html = markdownToHtml(markdown);
const fragment = serializer.deserialize(html).document;
return state.transform().insertFragment(fragment).apply();
}