FIX: Pasted text removing if server unable to parse HTML to Markdown

This commit is contained in:
Vinoth Kannan 2017-12-08 13:38:54 +05:30
parent 2ff3444568
commit 0a47642003

View File

@ -670,7 +670,11 @@ export default Ember.Component.extend({
type: 'POST',
data: { html }
}).then(response => {
self.appEvents.trigger('composer:replace-text', placeholder, response.markdown);
if (response.markdown) {
self.appEvents.trigger('composer:replace-text', placeholder, response.markdown);
} else if (!plainText) {
self.appEvents.trigger('composer:replace-text', placeholder, "");
}
}).catch(error => {
if (!plainText) {
self.appEvents.trigger('composer:replace-text', placeholder, "");