Skip to content

Commit 727cad9

Browse files
Potential fix for code scanning alert no. 11: Replacement of a substring with itself
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 3affafd commit 727cad9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function getTextBySelector(selector) {
6161
const toSafe = (s) =>
6262
typeof CSS !== 'undefined' && CSS.escape
6363
? CSS.escape(s)
64-
: s.replace(/[\"]/g, '$&').replace(/]/g, ']');
64+
: s.replace(/[\"]/g, '$&').replace(/]/g, '\\]');
6565

6666
const modifiedParts = parts.map((part) => {
6767
if (!part.includes('*')) return part;

0 commit comments

Comments
 (0)