FIX: Can't quote last paragraph.

This commit is contained in:
Guo Xiang Tan 2017-05-11 16:49:46 +08:00
parent b2b10c0f3c
commit ce9fe213fd

View File

@ -33,7 +33,8 @@ export default Ember.Component.extend({
for (let r = 0; r < selection.rangeCount; r++) {
const range = selection.getRangeAt(r);
if ($(range.endContainer).closest('.cooked').length === 0) return;
const withinCooked = range.startContainer.parentNode.closest('.cooked');
if (!withinCooked || withinCooked.length === 0) return;
const $ancestor = $(range.commonAncestorContainer);