Skip to content

Commit e554c2f

Browse files
bentolorstefanw
authored andcommittedFeb 6, 2025·
fix(escapeJsString): unbork code broken by prettier
This revert's a prettier change which breaks the JS encoding of sources like c't. They get messed up to something like c\`t which Genios dutyfully acknowledges with a HTTP 400 Bad request. More see #514 Closes #514
1 parent d99d28f commit e554c2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
const ident = (x) => x
32

43
function interpolate(
@@ -25,7 +24,8 @@ function interpolate(
2524
}
2625

2726
const escapeJsString = (str) => {
28-
return str.replace(/\\/g, '\\\\').replace(/'/g, "\\'")
27+
// prettier-ignore
28+
return str.replace(/\\/g, '\\\\').replace(/'/g, '\\\'')
2929
}
3030

3131
export { escapeJsString, interpolate }

0 commit comments

Comments
 (0)
Please sign in to comment.