feat: validate quotes to be single or double
This commit is contained in:
@@ -468,6 +468,26 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => {
|
|||||||
const regexExcessiveSpaces =
|
const regexExcessiveSpaces =
|
||||||
/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;
|
/(^|\\+)?(\\[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<typeof defaultOptions> = {}) {
|
||||||
|
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) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user