mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
fix: handle windows newlines on newline_to_br and strip_newlines
This commit is contained in:
+1
-1
@@ -28,7 +28,7 @@ export function escape_once (str: string) {
|
||||
}
|
||||
|
||||
export function newline_to_br (v: string) {
|
||||
return stringify(v).replace(/\n/g, '<br />\n')
|
||||
return stringify(v).replace(/\r?\n/gm, '<br />\n')
|
||||
}
|
||||
|
||||
export function strip_html (v: string) {
|
||||
|
||||
@@ -74,7 +74,7 @@ export function strip (v: string, chars?: string) {
|
||||
}
|
||||
|
||||
export function strip_newlines (v: string) {
|
||||
return stringify(v).replace(/\n/g, '')
|
||||
return stringify(v).replace(/\r?\n/gm, '')
|
||||
}
|
||||
|
||||
export function capitalize (str: string) {
|
||||
|
||||
Reference in New Issue
Block a user