From 860921e47eaec4e2b42cc390798f9185679f2955 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 27 May 2012 17:31:46 +0200 Subject: [PATCH] Make use of post.blockquote. --- 4chan_x.user.js | 4 ++-- script.coffee | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index c2e754f12..2cdcfc84b 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -648,7 +648,7 @@ comment: function(post) { var data, i, nodes, text, _i, _ref; text = []; - nodes = d.evaluate('.//br|.//text()', post.el.lastElementChild, null, 7, null); + nodes = d.evaluate('.//br|.//text()', post.blockquote, null, 7, null); for (i = _i = 0, _ref = nodes.snapshotLength; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { text.push((data = nodes.snapshotItem(i).data) ? data : '\n'); } @@ -3346,7 +3346,7 @@ if (post.isInlined && !post.isCrosspost) { return; } - snapshot = d.evaluate('.//text()[not(parent::a)]', post.el.lastElementChild, null, 6, null); + snapshot = d.evaluate('.//text()[not(parent::a)]', post.blockquote, null, 6, null); for (i = _i = 0, _ref = snapshot.snapshotLength; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { node = snapshot.snapshotItem(i); data = node.data; diff --git a/script.coffee b/script.coffee index 3b3ff6103..4d04b0dcb 100644 --- a/script.coffee +++ b/script.coffee @@ -512,7 +512,7 @@ Filter = comment: (post) -> text = [] # XPathResult.ORDERED_NODE_SNAPSHOT_TYPE is 7 - nodes = d.evaluate './/br|.//text()', post.el.lastElementChild, null, 7, null + nodes = d.evaluate './/br|.//text()', post.blockquote, null, 7, null for i in [0...nodes.snapshotLength] text.push if data = nodes.snapshotItem(i).data then data else '\n' text.join '' @@ -2530,7 +2530,7 @@ Quotify = # XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE is 6 # Get all the text nodes that are not inside an anchor. - snapshot = d.evaluate './/text()[not(parent::a)]', post.el.lastElementChild, null, 6, null + snapshot = d.evaluate './/text()[not(parent::a)]', post.blockquote, null, 6, null for i in [0...snapshot.snapshotLength] node = snapshot.snapshotItem i