diff --git a/src/robot.js b/src/robot.js index de7e77904..f6a93640e 100644 --- a/src/robot.js +++ b/src/robot.js @@ -524,7 +524,7 @@ class Robot { const body = fs.readFileSync(require.resolve(path), 'utf-8') const useStrictHeaderRegex = /^["']use strict['"];?\s+/ - const lines = body.replace(useStrictHeaderRegex, '').split('\n') + const lines = body.replace(useStrictHeaderRegex, '').split(/(?:\n|\r\n|\r)/) .reduce(toHeaderCommentBlock, {lines: [], isHeader: true}).lines .filter(Boolean) // remove empty lines let currentSection = null