From b49c007a36109404e6d561526d4817b82c282b0c Mon Sep 17 00:00:00 2001 From: Riley Seaburg Date: Tue, 24 Sep 2024 14:46:14 -0500 Subject: [PATCH] Fix code scanning alert no. 1: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- assets/uswds/js/uswds.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/uswds/js/uswds.js b/assets/uswds/js/uswds.js index 06daa22..fb870ae 100644 --- a/assets/uswds/js/uswds.js +++ b/assets/uswds/js/uswds.js @@ -628,7 +628,7 @@ var trim = String.prototype.trim ? function (str) { return str.replace(RE_TRIM, ''); }; var queryById = function (id) { - return this.querySelector('[id="' + id.replace(/"/g, '\\"') + '"]'); + return this.querySelector('[id="' + id.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"]'); }; module.exports = function resolveIds(ids, doc) { if (typeof ids !== 'string') {