We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50c7333 commit ef5d449Copy full SHA for ef5d449
generators/src/main/java/com/algolia/codegen/cts/lambda/EscapeSlashLambda.java
@@ -10,6 +10,7 @@ public class EscapeSlashLambda implements Mustache.Lambda {
10
@Override
11
public void execute(Template.Fragment fragment, Writer writer) throws IOException {
12
String text = fragment.execute();
13
- writer.write(text.replace("\\", "\\\\"));
+ // replace all backslashes with double backslashes, unless they are followed by a $
14
+ writer.write(text.replaceAll("\\\\(?!\\$)", "\\\\\\\\"));
15
}
16
0 commit comments