Comparing version 0.2.2 to 0.2.3
@@ -13,7 +13,7 @@ var convert = require("encoding").convert, | ||
*/ | ||
this.foldLine = function(str, maxLength, foldAnywhere, afterSpace){ | ||
this.foldLine = function(str, maxLength, foldAnywhere, afterSpace, lineMargin){ | ||
if(foldAnywhere){ | ||
return addBase64SoftLinebreaks(str, maxLength || 76); | ||
} | ||
return module.exports.mimeFunctions.foldLine(str, maxLength, !!afterSpace); | ||
return module.exports.mimeFunctions.foldLine(str, maxLength, !!afterSpace, lineMargin); | ||
}; | ||
@@ -344,7 +344,7 @@ | ||
foldLine: function(str, lineLengthMax, afterSpace){ | ||
foldLine: function(str, lineLengthMax, afterSpace, lineMargin){ | ||
lineLengthMax = lineLengthMax || 76; | ||
str = (str || "").toString().trim(); | ||
var pos = 0, len = str.length, result = "", line, match, lineMargin = Math.floor(lineLengthMax/5); | ||
var pos = 0, len = str.length, result = "", line, match, lineMargin = lineMargin || Math.floor(lineLengthMax/5); | ||
@@ -351,0 +351,0 @@ while(pos < len){ |
{ | ||
"name": "mimelib", | ||
"description": "MIME functions to encode/decode e-mails etc.", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"author" : "Andris Reinman", | ||
@@ -6,0 +6,0 @@ "homepage":"http://github.com/andris9/mimelib", |
@@ -110,1 +110,11 @@ var testCase = require('nodeunit').testCase, | ||
exports["Fold long line"] = function(test){ | ||
var inputStr = "Subject: Testin command line kirja õkva kakva mõni tõnis kõllas põllas tõllas rõllas jušla kušla tušla musla", | ||
outputStr = "Subject: Testin command line kirja =?UTF-8?Q?=C3=B5kva?= kakva\r\n"+ | ||
" =?UTF-8?Q?m=C3=B5ni_t=C3=B5nis_k=C3=B5llas_p=C3=B5?=\r\n"+ | ||
" =?UTF-8?Q?llas_t=C3=B5llas_r=C3=B5llas_ju=C5=A1la_?=\r\n"+ | ||
" =?UTF-8?Q?ku=C5=A1la_tu=C5=A1la?= musla"; | ||
test.equal(outputStr, mimelib.foldLine(mimelib.encodeMimeWords(inputStr, "Q", 52), 76, false, false, 52)); | ||
test.done(); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
647310
764