Skip to content

Commit efe3067

Browse files
authored
Merge pull request #1656 from achuanya/pr
Fix: Windows CRLF line ending compatibility for filters
2 parents 6e7fb20 + 63545a9 commit efe3067

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/transformers/filters/defaultFilters.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const modulo = (content, attribute) => Number.parseFloat(content) % Number.parse
3030

3131
const multiply = (content, attribute) => Number.parseFloat(content) * Number.parseFloat(attribute)
3232

33-
const newlineToBr = content => content.replace(/\n/g, '<br>')
33+
const newlineToBr = content => content.replace(/\r?\n/g, '<br>')
3434

3535
const plus = (content, attribute) => Number.parseFloat(content) + Number.parseFloat(attribute)
3636

@@ -76,7 +76,7 @@ const slice = (content, attribute) => {
7676
return content.slice(start, end)
7777
}
7878

79-
const stripNewlines = content => content.replace(/\n/g, '')
79+
const stripNewlines = content => content.replace(/\r?\n/g, '')
8080

8181
const trim = content => content.trim()
8282

0 commit comments

Comments
 (0)