diff --git a/4chan_x.js b/4chan_x.js index c8ce3f9f8..d3aaee38f 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1678,9 +1678,10 @@ return g.callbacks.push(quoteBacklink.node); }, node: function(root) { - var el, id, link, qid, quote, quotes, _i, _len, _ref, _results; + var el, id, link, qid, quote, quotes, tid, _i, _len, _ref, _results; id = root.id || $('td[id]', root).id; quotes = {}; + tid = g.THREAD_ID; _ref = $$('a.quotelink', root); for (_i = 0, _len = _ref.length; _i < _len; _i++) { quote = _ref[_i]; @@ -1688,6 +1689,9 @@ continue; } qid = qid[0]; + if (qid === tid) { + continue; + } quotes[qid] = quote; } _results = []; diff --git a/script.coffee b/script.coffee index 4767ead21..5ab2639af 100644 --- a/script.coffee +++ b/script.coffee @@ -1352,9 +1352,12 @@ quoteBacklink = #better coffee-script way of doing this? id = root.id or $('td[id]', root).id quotes = {} + tid = g.THREAD_ID for quote in $$ 'a.quotelink', root continue unless qid = quote.textContent.match /\d+/ [qid] = qid + #don't backlink the op + continue if qid == tid #duplicate quotes get overwritten quotes[qid] = quote for qid, quote of quotes