From a5848682b33cf575819a73489330e6ddd90de188 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 24 Nov 2020 20:53:11 +0300 Subject: [PATCH] normalize linebreaks in parseMozFormat --- js/moz-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/moz-parser.js b/js/moz-parser.js index d79c4789..8d6d2a31 100644 --- a/js/moz-parser.js +++ b/js/moz-parser.js @@ -22,7 +22,7 @@ function parseMozFormat({code, styleId}) { const sectionStack = [{code: '', start: 0}]; const errors = []; const sections = []; - const mozStyle = code; + const mozStyle = code.replace(/\r\n?/g, '\n'); // same as parserlib.StringReader parser.addListener('startdocument', e => { const lastSection = sectionStack[sectionStack.length - 1];