restore previous behaviour with \n in strings

An incompatible change (that actually breaks po parsing after writing) had
been introduced with commit e164fcfe9d. If
_process returned an array (which is the case for strings containing \n
character), array.toString will return a comma separated list, which is not
valid po syntax. Added a test to restore the behaviour from before the
e164fcfe9d.
This commit is contained in:
Julian Bäume
2014-06-23 12:17:40 +02:00
parent 8e49417916
commit af94d8ff5e
2 changed files with 11 additions and 1 deletions

View File

@@ -261,7 +261,8 @@ PO.Item.prototype.toString = function () {
});
} else {
text = isArray(text) ? text.join() : text;
lines = lines.concat(mkObsolete + _process(keyword, text));
var processed = _process(keyword, text);
lines = lines.concat(mkObsolete + processed.join('\n' + mkObsolete));
}
}
});