Skip to content

Commit

Permalink
Adjust for windows machins (CRLF carriage returns)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickschubert committed Sep 8, 2019
1 parent cd500a8 commit 14f3386
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -243,7 +243,7 @@
"compile": "tsc -p ./ && copyfiles -u 1 src/webview.html out",
"watch": "npm run compile && copyfiles -u 1 src/courierprime/*.ttf out && copyfiles -u 1 src/noisetexture.png out",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "./node_modules/jest/bin/jest.js"
"test": "node node_modules/jest/bin/jest.js"
},
"devDependencies": {
"@types/jest": "^24.0.18",
Expand Down
6 changes: 4 additions & 2 deletions src/statistics.ts
Expand Up @@ -93,9 +93,11 @@ const createSceneStatistics = (script: string): singleSceneStatistic[] => {
}

export const retrieveScreenPlayStatistics = (script: string): screenPlayStatistics => {
// These adjustments are necessary for Windows style CRLF carriage returns
const scriptNormalised = script.replace(/\r\n/gm, "\n")
return {
characterStats: createCharacterStatistics(script),
sceneStats: createSceneStatistics(script)
characterStats: createCharacterStatistics(scriptNormalised),
sceneStats: createSceneStatistics(scriptNormalised)
}
}

Expand Down

0 comments on commit 14f3386

Please sign in to comment.