From 358efd6dea75deb328111e1683ae012845d5b142 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Thu, 6 Jun 2024 01:25:44 +0530 Subject: [PATCH] feat: handle edge cases for valid selectors starting with hyphen or numbers --- server/src/workflow-management/selector.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/workflow-management/selector.ts b/server/src/workflow-management/selector.ts index 5bfd3e68..c211669b 100644 --- a/server/src/workflow-management/selector.ts +++ b/server/src/workflow-management/selector.ts @@ -529,6 +529,14 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => { } output += value; } + + if (isIdentifier) { + if (/^-[-\d]/.test(output)) { + output = '\\-' + output.slice(1); + } else if (/\d/.test(firstChar)) { + output = '\\3' + firstChar + ' ' + output.slice(1); + } + } }