Fix parsing of /f/ quotelinks.

This commit is contained in:
ccd0 2015-05-02 17:53:03 -07:00
parent 21672318d9
commit fd93d359a0
2 changed files with 4 additions and 2 deletions

View File

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

View File

@ -220,7 +220,7 @@ ThreadWatcher =
continue unless QR.db and postObj.com
quotesYou = false
regexp = /<a [^>]*\bhref="(?:\/([^\/]+)\/thread\/(\d+))?(?:#p(\d+))?"/g
regexp = /<a [^>]*\bhref="(?:\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g
while match = regexp.exec postObj.com
if QR.db.get {
boardID: match[1] or boardID