Skip to content

Commit

Permalink
fix: make div in table when replaceContent is executed (fix: #535)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sohee Lee authored and sohee-lee7 committed Jun 11, 2019
1 parent 793c3ec commit c1c163b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/js/wwTextObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ class WwTextObject {
replaceContent(content) {
this._wwe.getEditor().setSelection(this._range);
this._wwe.getEditor().insertHTML(content);

// When range is in table, 'insertHTML' makes div in table.
// So after 'insertHTML', div in table should be unwrap.
// 'wysiwygRangeChangeAfter' event let wwTableManager call '_unwrapBlockInTable'
if (this._wwe.isInTable(this._range)) {
this._wwe.eventManager.emit('wysiwygRangeChangeAfter', this._wwe);
}

this._range = this._wwe.getRange();
}

Expand Down

0 comments on commit c1c163b

Please sign in to comment.