From f28964138efe22b4f08f409cffc46be632224354 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 11 Dec 2011 18:38:10 +0100 Subject: [PATCH] Fix quoting OP, optimize. Kill two birds with in one stone. --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index a59a61ab3..dcfc4895e 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1680,7 +1680,7 @@ text = ">>" + id + "\n"; selection = window.getSelection(); if (s = selection.toString()) { - selectionID = (_ref = $.x('ancestor::blockquote', selection.anchorNode)) != null ? _ref.parentNode.firstElementChild.name : void 0; + selectionID = (_ref = $.x('ancestor::blockquote/preceding-sibling::input', selection.anchorNode)) != null ? _ref.name : void 0; if (selectionID === id) { s = s.replace(/\n/g, '\n>'); text += ">" + s + "\n"; diff --git a/script.coffee b/script.coffee index 56a5d3ad8..ca8a7db52 100644 --- a/script.coffee +++ b/script.coffee @@ -1316,7 +1316,7 @@ qr = selection = window.getSelection() if s = selection.toString() - selectionID = $.x('ancestor::blockquote', selection.anchorNode)?.parentNode.firstElementChild.name + selectionID = $.x('ancestor::blockquote/preceding-sibling::input', selection.anchorNode)?.name if selectionID is id s = s.replace /\n/g, '\n>' text += ">#{s}\n"