From 803734c8962e33c26d14078dfd8a0cb895c79db6 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 12 Mar 2012 14:37:10 +0100 Subject: [PATCH] Fix board when quotifying a cross-board inlined post. --- 4chan_x.user.js | 2 +- script.coffee | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 3ec108e96..b6faaec09 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3358,7 +3358,7 @@ index = data.indexOf(quote); if (text = data.slice(0, index)) nodes.push($.tn(text)); id = quote.match(/\d+$/)[0]; - board = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : g.BOARD; + board = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : $('.quotejs', post.el).pathname.split('/')[1]; if (board === g.BOARD && $.id(id)) { href = "#" + id; className = 'quotelink'; diff --git a/script.coffee b/script.coffee index 3c21b0046..6c36c4d06 100644 --- a/script.coffee +++ b/script.coffee @@ -2801,7 +2801,12 @@ Quotify = nodes.push $.tn text id = quote.match(/\d+$/)[0] - board = if m = quote.match /^>>>\/([a-z\d]+)/ then m[1] else g.BOARD + board = + if m = quote.match /^>>>\/([a-z\d]+)/ + m[1] + else + # Get the post's board, whether it's inlined or not. + $('.quotejs', post.el).pathname.split('/')[1] if board is g.BOARD and $.id id href = "##{id}" className = 'quotelink'