From c7c62caa54af4b661280a4a5cd38533951fe31b7 Mon Sep 17 00:00:00 2001 From: Sander Houttekier Date: Thu, 31 Oct 2013 14:13:25 +0100 Subject: [PATCH] Update parsing of headers Remove wrong `.replace()` statement which breaks any language file from a language ending with the character `n`. It is unclear to me why this replace is even there. As it is even invalid to replace without supplying a string with what it needs to be replaced. --- lib/po.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/po.js b/lib/po.js index 2accd8f..50cb0a1 100644 --- a/lib/po.js +++ b/lib/po.js @@ -81,7 +81,7 @@ PO.parse = function(data) { header = header.trim().replace(/^"/, '').replace(/\\n"$/, ''); var p = header.split(/:/) , name = p.shift().trim() - , value = p.join(':').trim().replace(/n$/); + , value = p.join(':').trim(); po.headers[name] = value; } }); @@ -202,4 +202,4 @@ PO.Item.prototype.toString = function() { return lines.join("\n"); }; -module.exports = PO; \ No newline at end of file +module.exports = PO;