diff --git a/src/Quotelinks/Quotify.coffee b/src/Quotelinks/Quotify.coffee index 958597c33..0bd0e40d3 100644 --- a/src/Quotelinks/Quotify.coffee +++ b/src/Quotelinks/Quotify.coffee @@ -11,10 +11,23 @@ Quotify = node: -> return if @isClone + for link in $$ 'a.linkify', @nodes.comment + Quotify.parseArchiveLink.call @, link for deadlink in $$ '.deadlink', @nodes.comment Quotify.parseDeadlink.call @, deadlink return + parseArchiveLink: (link) -> + return unless Redirect.archives.some (o) -> link.host is o.domain + return unless (m = link.pathname.match /^\/([^/]+)\/thread\/S?(\d+)\/?/) + boardID = m[1] + threadID = m[2] + postID = link.hash.match(/^#p?(\d+)$|$/)[1] or threadID + if Redirect.to 'post', {boardID, postID} + $.addClass link, 'quotelink' + $.extend link.dataset, {boardID, threadID, postID} + @nodes.quotelinks.push link + parseDeadlink: (deadlink) -> if $.hasClass deadlink.parentNode, 'prettyprint' # Don't quotify deadlinks inside code tags, diff --git a/src/config/Config.coffee b/src/config/Config.coffee index aea391bdc..44c11e7e3 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -547,7 +547,7 @@ Config = ] 'Resurrect Quotes': [ true - 'Link dead quotes to the archives.' + 'Link dead quotes to the archives, and support inlining/previewing of archive links like quote links.' ] 'Remember Your Posts': [ true