From fd93d359a0e862832a8b494fa372ff8a97da60d2 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 2 May 2015 17:53:03 -0700 Subject: [PATCH] Fix parsing of /f/ quotelinks. --- src/General/Build.coffee | 4 +++- src/Monitoring/ThreadWatcher.coffee | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/General/Build.coffee b/src/General/Build.coffee index e5cacf910..0b76f84e1 100755 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -139,13 +139,15 @@ Build = id: "pc#{postID}" $.extend container, wholePost - # Fix pathnames + # Fix quotelinks for quote in $$ '.quotelink', container href = quote.getAttribute 'href' if (href[0] is '#') and !(Build.sameThread boardID, threadID) quote.href = "/#{boardID}/thread/#{threadID}" + href else if (match = href.match /^\/([^\/]+)\/thread\/(\d+)/) and (Build.sameThread match[1], match[2]) quote.href = href.match(/(#[^#]*)?$/)[0] or '#' + else if /^\d+(#|$)/.test(href) and not (g.VIEW is 'thread' and g.BOARD.ID is boardID) # used on /f/ + quote.href = "/#{boardID}/thread/#{href}" container diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 9a029947f..c437066c6 100755 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -220,7 +220,7 @@ ThreadWatcher = continue unless QR.db and postObj.com quotesYou = false - regexp = /]*\bhref="(?:\/([^\/]+)\/thread\/(\d+))?(?:#p(\d+))?"/g + regexp = /]*\bhref="(?:\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g while match = regexp.exec postObj.com if QR.db.get { boardID: match[1] or boardID