Skip to content

Commit 5548fa6

Browse files
Merge pull request #1866 from rocketstack-matt/fix/shared-incomplete-string-escaping
fix(shared): escape backslashes before quotes in template preprocessor
2 parents a326d37 + 83c62b6 commit 5548fa6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared/src/template/template-preprocessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ export class TemplatePreprocessor {
385385
return { decision: { kind: 'leave', seg, reason: 'native-handlebars-path' } };
386386
}
387387

388-
const safePath = path.replace(/"/g, '\\"');
388+
const safePath = path.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
389389
const { kvs, positionals } = TemplatePreprocessor.splitExtrasFromString(extras);
390390
const kvsPart = kvs.length ? ` ${kvs.join(' ')}` : '';
391391
const posPart = positionals.length ? ` ${positionals.join(' ')}` : '';

0 commit comments

Comments
 (0)