Skip to content

Commit

Permalink
fix: correctly escape string with debug: true
Browse files Browse the repository at this point in the history
  • Loading branch information
nebrelbug committed Aug 23, 2023
1 parent ee6d336 commit 115721d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let includeAsync = (template, data) => this.renderAsync(template, data, options)
let __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${
config.debug
? ', line: 1, templateStr: "' +
str.replace(/\\|'/g, "\\$&").replace(/\r\n|\n|\r/g, "\\n") +
str.replace(/\\|"/g, "\\$&").replace(/\r\n|\n|\r/g, "\\n") +
'"'
: ""
}};
Expand Down

0 comments on commit 115721d

Please sign in to comment.