Fix parsing of /f/ quotelinks.
This commit is contained in:
parent
21672318d9
commit
fd93d359a0
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user