From 5535e07bb8f117f39dd1a9ce37b42a8bd74f8663 Mon Sep 17 00:00:00 2001 From: drfloyd5 <5687006+drfloyd5@users.noreply.github.com> Date: Tue, 14 Feb 2023 19:52:42 -0500 Subject: [PATCH] Issue-25 Added `escapedPath` to `changePathVisibility` to handle carriage return (\r) and other invalid querySelector paths characters. --- src/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 932d382..faddbc4 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,6 @@ export function changePathVisibility(path: string, hide: boolean) { - let n = document.querySelector(`[data-path="${path}"]`); + let escapedPath = CSS.escape(path); + let n = document.querySelector(`[data-path="${escapedPath}"]`); if (!n) { return; };