feat: handle edge cases for valid selectors starting with hyphen or numbers

This commit is contained in:
karishmas6
2024-06-06 01:25:44 +05:30
parent e241a7a99b
commit 358efd6dea

View File

@@ -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);
}
}
}