From 52d74f9ea4e6e1638bb6d1239832508d08edcbd4 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Thu, 6 Jun 2024 01:23:26 +0530 Subject: [PATCH] feat: validate quotes to be single or double --- server/src/workflow-management/selector.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/server/src/workflow-management/selector.ts b/server/src/workflow-management/selector.ts index 9d2cfe81..61fdc92a 100644 --- a/server/src/workflow-management/selector.ts +++ b/server/src/workflow-management/selector.ts @@ -468,6 +468,26 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => { const regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; + const defaultOptions = { + escapeEverything: false, + isIdentifier: false, + quotes: 'single', + wrap: false, + }; + + function cssesc(string: string, opt: Partial = {}) { + const options = { ...defaultOptions, ...opt }; + if (options.quotes != 'single' && options.quotes != 'double') { + options.quotes = 'single'; + } + const quote = options.quotes == 'double' ? '"' : "'"; + const isIdentifier = options.isIdentifier; + + + } + + + }; @@ -477,4 +497,3 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => { -