handle empty comments correctly
since the lines in the parser have all newline characters removed, \s+ will not match empty comments. Added an example that makes other tests fail without this patch.
This commit is contained in:
@@ -146,9 +146,9 @@ PO.parse = function (data) {
|
||||
for (var i = 0; i < flags.length; i++) {
|
||||
item.flags[flags[i]] = true;
|
||||
}
|
||||
} else if (line.match(/^#\s+/)) { // Translator comment
|
||||
} else if (line.match(/^#($|\s+)/)) { // Translator comment
|
||||
finish();
|
||||
item.comments.push(trim(line.replace(/^#\s+/, '')));
|
||||
item.comments.push(trim(line.replace(/^#($|\s+)/, '')));
|
||||
} else if (line.match(/^#\./)) { // Extracted comment
|
||||
finish();
|
||||
item.extractedComments.push(trim(line.replace(/^#\./, '')));
|
||||
|
||||
Reference in New Issue
Block a user