Skip to content

Commit

Permalink
0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
j0k3r committed Sep 27, 2016
1 parent d4920b8 commit 77bd08f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

0.5.3 / 2016-09-27
==================
* Fix detached tbody from table

0.5.2 / 2016-06-20
==================
* Fix electron environment
Expand Down
10 changes: 8 additions & 2 deletions dist/js/medium-editor-tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ Table.prototype = {
this._editor.pasteHTML(
'<table class="medium-editor-table" id="medium-editor-table"' +
' width="100%">' +
'<tbody>' +
'<tbody id="medium-editor-table-tbody">' +
html +
'</tbody>' +
'</table>', {
Expand All @@ -422,7 +422,13 @@ Table.prototype = {
}
);

var table = this._doc.getElementById('medium-editor-table');
var table = this._doc.getElementById('medium-editor-table'),
tbody = this._doc.getElementById('medium-editor-table-tbody');
if (0 === $(table).find('#medium-editor-table-tbody').length) {
//Edge case, where tbody gets appended outside table tag
$(tbody).detach().appendTo(table);
}
tbody.removeAttribute('id');
table.removeAttribute('id');
placeCaretAtNode(this._doc, table.querySelector('td'), true);

Expand Down
Loading

0 comments on commit 77bd08f

Please sign in to comment.