Skip to content

Commit 2276685

Browse files
chore: Potential fix for code scanning alert no. 2: Incomplete string escaping or encoding
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent e669bd3 commit 2276685

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/locators/locator-generation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function isValidValue(value: string | undefined): value is string {
1616
* Escape special characters in text for use in selectors
1717
*/
1818
function escapeText(text: string): string {
19-
return text.replace(/"/g, '\\"').replace(/\n/g, '\\n');
19+
return text.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n');
2020
}
2121

2222
/**

0 commit comments

Comments
 (0)