Skip to content

Commit acb34f6

Browse files
committed
Fix: Windows CRLF line ending compatibility for filters
1 parent 604065f commit acb34f6

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)