Skip to content

Commit

Permalink
Merge pull request #25 from meister/patch-1
Browse files Browse the repository at this point in the history
Update mimelib.js
  • Loading branch information
andris9 committed Aug 7, 2014
2 parents de03001 + 77b88d8 commit 8387018
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/mimelib.js
Expand Up @@ -308,7 +308,7 @@ module.exports.mimeFunctions = {

var fromCharset, encoding, match;

match = str.match(/^\=\?([\w_\-]+)\?([QqBb])\?([^\?]+)\?\=$/i);
match = str.match(/^\=\?([\w_\-]+)\?([QqBb])\?([^\?]*)\?\=$/i);
if (!match) {
return convert(str, toCharset);
}
Expand All @@ -332,8 +332,8 @@ module.exports.mimeFunctions = {
var curCharset;

str = (str || "").toString().
replace(/(=\?[^?]+\?[QqBb]\?[^?]+\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]+\?=)/g, "$1").
replace(/\=\?([\w_\-]+)\?([QqBb])\?[^\?]+\?\=/g, (function(mimeWord, charset, encoding) {
replace(/(=\?[^?]+\?[QqBb]\?[^?]+\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g, "$1").
replace(/\=\?([\w_\-]+)\?([QqBb])\?[^\?]*\?\=/g, (function(mimeWord, charset, encoding) {
curCharset = charset + encoding;
return this.decodeMimeWord(mimeWord);
}).bind(this));
Expand Down Expand Up @@ -581,4 +581,4 @@ function checkRanges(nr, ranges) {
}
}
return false;
}
}

0 comments on commit 8387018

Please sign in to comment.