From e3c4b669186e9e764781c2a10d2bb83fcded944f Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 20 Jul 2011 06:26:03 +0200 Subject: [PATCH] Fix Quote Inlining when the quote is at the end of the last line, after some text. --- 4chan_x.user.js | 2 +- changelog | 1 + script.coffee | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 3c41dc3f8..60a1b799a 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2055,7 +2055,7 @@ } return; } - root = this.parentNode.nodeName === 'FONT' ? this.parentNode : this.nextSibling; + root = this.parentNode.nodeName === 'FONT' ? this.parentNode : this.nextSibling ? this.nextSibling : this; if (el = d.getElementById(id)) { inline = quoteInline.table(id, el.innerHTML); if (this.className === 'backlink') { diff --git a/changelog b/changelog index 41a607aee..b8bb902de 100644 --- a/changelog +++ b/changelog @@ -2,6 +2,7 @@ github - mayhem: - Thread Stats performance fix, especially on long threads - Sauce performance improvement + - fix Quote Inlining for a pattern - aeosynth: - fix an upgrading problem (1.x -> 2.x) diff --git a/script.coffee b/script.coffee index 5fe557425..bcf31bee7 100644 --- a/script.coffee +++ b/script.coffee @@ -1606,7 +1606,7 @@ quoteInline = for inlined in $$ 'input', table $.show $.x 'ancestor::table[1]', d.getElementById inlined.name return - root = if @parentNode.nodeName is 'FONT' then @parentNode else @nextSibling + root = if @parentNode.nodeName is 'FONT' then @parentNode else if @nextSibling then @nextSibling else @ if el = d.getElementById id inline = quoteInline.table id, el.innerHTML if @className is 'backlink'