From 4b332e19e0153887b28ff4292461fde68b488ab7 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Sat, 10 Aug 2013 15:26:34 +0200 Subject: [PATCH] Fix #1196, #1222. --- src/Quotelinks/Quotify.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Quotelinks/Quotify.coffee b/src/Quotelinks/Quotify.coffee index 1d26c6e79..8f94ee226 100644 --- a/src/Quotelinks/Quotify.coffee +++ b/src/Quotelinks/Quotify.coffee @@ -21,11 +21,15 @@ Quotify = # This won't be necessary once 4chan # stops quotifying inside code tags: # https://github.com/4chan/4chan-JS/issues/77 - $.replace deadlink, [deadlink.childNodes...] + Quotify.fixDeadlink deadlink return quote = deadlink.textContent return unless postID = quote.match(/\d+$/)?[0] + if postID[0] is '0' + # Fix quotelinks that start with a `0`. + Quotify.fixDeadlink deadlink + return boardID = if m = quote.match /^>>>\/([a-z\d]+)/ m[1] else @@ -70,3 +74,6 @@ Quotify = $.replace deadlink, a if $.hasClass a, 'quotelink' @nodes.quotelinks.push a + + fixDeadlink: (deadlink) -> + $.replace deadlink, [deadlink.childNodes...]