Skip to content

Commit

Permalink
MDL-49693 atto: Clean textarea contents before inserting into editor
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmerrill committed Mar 27, 2015
1 parent 0a4b99f commit 93e80c9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -674,16 +674,15 @@ EditorTextArea.prototype = {
// Clear it first.
this.editor.setHTML('');

// Copy text to editable div.
this.editor.append(this.textarea.get('value'));

// Clean it.
this.cleanEditorHTML();
// Copy cleaned HTML to editable div.
this.editor.append(this._cleanHTML(this.textarea.get('value')));

// Insert a paragraph in the empty contenteditable div.
if (this.editor.getHTML() === '') {
this.editor.setHTML(this._getEmptyContent());
}

return this;
},

/**
Expand Down
Loading

0 comments on commit 93e80c9

Please sign in to comment.