Comparing version 1.0.1 to 1.0.2
@@ -67,6 +67,11 @@ var fs = require('fs'); | ||
var sections = data.split(/\n\n/); | ||
var headers = [sections.shift()]; | ||
var headers = []; | ||
//everything until the first 'msgid ""' is considered header | ||
while (headers[headers.length - 1].indexOf('msgid ""') < 0) { | ||
headers.push(sections.shift()); | ||
while (sections[0] && (headers.length === 0 || headers[headers.length - 1].indexOf('msgid ""') < 0)) { | ||
if (sections[0].match(/msgid "[^"]/)) { | ||
//found first real string, adding a dummy header item | ||
headers.push('msgid ""'); | ||
} else { | ||
headers.push(sections.shift()); | ||
} | ||
} | ||
@@ -73,0 +78,0 @@ headers = headers.join('\n'); |
{ | ||
"name": "pofile", | ||
"description": "Parse and serialize Gettext PO files.", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Ruben Vermeersch", |
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
18952
339