diff --git a/app/assets/javascripts/discourse/components/quote-button.js.es6 b/app/assets/javascripts/discourse/components/quote-button.js.es6 index 5b4fa06d97f..535ebe0272c 100644 --- a/app/assets/javascripts/discourse/components/quote-button.js.es6 +++ b/app/assets/javascripts/discourse/components/quote-button.js.es6 @@ -33,8 +33,7 @@ export default Ember.Component.extend({ for (let r = 0; r < selection.rangeCount; r++) { const range = selection.getRangeAt(r); - const withinCooked = range.startContainer.parentNode.closest('.cooked'); - if (!withinCooked || withinCooked.length === 0) return; + if ($(range.startContainer.parentNode).closest('.cooked').length === 0) return; const $ancestor = $(range.commonAncestorContainer);