From 5e0f808e7170ec88227a0889df4f94420c6d193f Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 14 Dec 2011 14:26:13 +0100 Subject: [PATCH] Fix quoting when selecting started from the end of a line on Firefox. This sounds really silly. --- 4chan_x.user.js | 2 +- changelog | 2 ++ script.coffee | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index b60f00b37..1db1a0992 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1683,7 +1683,7 @@ text = ">>" + id + "\n"; selection = window.getSelection(); if (s = selection.toString()) { - selectionID = (_ref = $.x('ancestor::blockquote/preceding-sibling::input', selection.anchorNode)) != null ? _ref.name : void 0; + selectionID = (_ref = $.x('ancestor-or-self::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/changelog b/changelog index ea7330a4a..3266202d4 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- mayhem + fix selection to quote when selecting started from the end of a line on Firefox 2.23.4 - mayhem diff --git a/script.coffee b/script.coffee index beefcba67..aa37759e8 100644 --- a/script.coffee +++ b/script.coffee @@ -1322,7 +1322,7 @@ qr = selection = window.getSelection() if s = selection.toString() - selectionID = $.x('ancestor::blockquote/preceding-sibling::input', selection.anchorNode)?.name + selectionID = $.x('ancestor-or-self::blockquote/preceding-sibling::input', selection.anchorNode)?.name if selectionID is id s = s.replace /\n/g, '\n>' text += ">#{s}\n"