Fix board when quotifying a cross-board inlined post.

This commit is contained in:
Nicolas Stepien 2012-03-12 14:37:10 +01:00
parent 305a567f9d
commit 803734c896
2 changed files with 7 additions and 2 deletions

View File

@ -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';

View File

@ -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'