From 3f3a3c5b9e3f67391ce5dffb2cd8e6bdd2eb72a7 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 7 May 2012 09:48:55 +0200 Subject: [PATCH] Fix #410. --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 06183f69c..d5f04a199 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1841,7 +1841,7 @@ }); ta.style.cssText = $.get('QR.size', ''); } - mimeTypes = $('.rules').firstElementChild.textContent.match(/: (.+)/)[1].toLowerCase().replace(/\w+/g, function(type) { + mimeTypes = $('.rules').firstElementChild.textContent.trim().match(/: (.+)/)[1].toLowerCase().replace(/\w+/g, function(type) { switch (type) { case 'jpg': return 'image/jpeg'; diff --git a/script.coffee b/script.coffee index 022c8f4ef..8be25ce58 100644 --- a/script.coffee +++ b/script.coffee @@ -1405,7 +1405,7 @@ QR = ta.style.cssText = $.get 'QR.size', '' # Allow only this board's supported files. - mimeTypes = $('.rules').firstElementChild.textContent.match(/: (.+)/)[1].toLowerCase().replace /\w+/g, (type) -> + mimeTypes = $('.rules').firstElementChild.textContent.trim().match(/: (.+)/)[1].toLowerCase().replace /\w+/g, (type) -> switch type when 'jpg' 'image/jpeg'