diff --git a/src/stringify/stringifyString.ts b/src/stringify/stringifyString.ts index 942b2d1a..d600ec66 100644 --- a/src/stringify/stringifyString.ts +++ b/src/stringify/stringifyString.ts @@ -165,6 +165,15 @@ function quotedString(value: string, ctx: StringifyContext) { return qs(value, ctx) } +// The negative lookbehind avoids a polynomial search, +// but isn't supported yet on Safari: https://caniuse.com/js-regexp-lookbehind +let blockEndNewlines: RegExp +try { + blockEndNewlines = new RegExp('(^|(?