From 29af83337b4eb50fabc33d18e0ad74dbc7c73a25 Mon Sep 17 00:00:00 2001 From: ahodesuka Date: Tue, 21 Feb 2012 08:08:07 -0600 Subject: [PATCH] Fix regex for spoilers. --- 4chan_x.user.js | 2 +- script.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index a9b98ada5..85572d2f1 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2897,7 +2897,7 @@ init: function() { Filesize.fstype = g.REPLY ? 0 : 1; Filesize.fsconf = ['filesizeR', 'filesizeT']; - Filesize.regEx = [/File:\s()-\(([\d\.]+)\s([BKM]{1,2}),\s(\d+)x(\d+),\s/, /File:\s()-\(([\d\.]+)\s([BKM]{1,2}),\s(\d+)x(\d+)\)/]; + Filesize.regEx = [/File:\s()-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+)x(\d+),\s/, /File:\s()-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+)x(\d+)\)/]; this.parse = function(node) { var filename, height, link, size, unit, width, _, _ref; _ref = node.innerHTML.match(Filesize.regEx[Filesize.fstype]), _ = _ref[0], link = _ref[1], size = _ref[2], unit = _ref[3], width = _ref[4], height = _ref[5], filename = _ref[6]; diff --git a/script.coffee b/script.coffee index 50a9e27f7..a1bf6971d 100644 --- a/script.coffee +++ b/script.coffee @@ -2338,8 +2338,8 @@ Filesize = init: -> Filesize.fstype = if g.REPLY then 0 else 1 Filesize.fsconf = [ 'filesizeR', 'filesizeT' ] - Filesize.regEx = [ /File:\s()-\(([\d\.]+)\s([BKM]{1,2}),\s(\d+)x(\d+),\s/, - /File:\s()-\(([\d\.]+)\s([BKM]{1,2}),\s(\d+)x(\d+)\)/ ] + Filesize.regEx = [ /File:\s()-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+)x(\d+),\s/, + /File:\s()-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+)x(\d+)\)/ ] @parse = (node) -> [_, link, size, unit, width, height, filename] = node.innerHTML.match Filesize.regEx[Filesize.fstype]