Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: fix backtick quote escaping (#36997)

Pavel Feldman27f4ec6b0a9c
diff --git a/packages/playwright-core/src/utils/isomorphic/stringUtils.ts b/packages/playwright-core/src/utils/isomorphic/stringUtils.ts
index 6cbab2670f..af0a07c0c1 100644
--- a/packages/playwright-core/src/utils/isomorphic/stringUtils.ts
+++ b/packages/playwright-core/src/utils/isomorphic/stringUtils.ts
@@ -23,7 +23,7 @@ export function escapeWithQuotes(text: string, char: string = '\'') {
if (char === '"')
return char + escapedText.replace(/["]/g, '\\"') + char;
if (char === '`')
- return char + escapedText.replace(/[`]/g, '`') + char;
+ return char + escapedText.replace(/[`]/g, '\\`') + char;
throw new Error('Invalid escape char');
}