diff --git a/lib/po.js b/lib/po.js index e22db97..2bfc3e6 100644 --- a/lib/po.js +++ b/lib/po.js @@ -262,6 +262,9 @@ PO.Item.prototype.toString = function () { } else { text = isArray(text) ? text.join() : text; var processed = _process(keyword, text); + for (var i = 1; i < processed.length - 1; i++) { + processed[i] = processed[i].slice(0, -1) + '\\n"'; + } lines = lines.concat(mkObsolete + processed.join('\n' + mkObsolete)); } } diff --git a/test/write.js b/test/write.js index dd319ad..06edb97 100644 --- a/test/write.js +++ b/test/write.js @@ -97,7 +97,7 @@ describe('Write', function () { item.msgid = '\n should be written escaped'; assertHasLine(item.toString(), 'msgid ""'); - assertHasLine(item.toString(), '""'); + assertHasLine(item.toString(), '"\\n"'); assertHasLine(item.toString(), '" should be written escaped"'); });