Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XPath treated as a comment when using better-comments #535

Open
TJGinis opened this issue Aug 28, 2024 · 1 comment
Open

XPath treated as a comment when using better-comments #535

TJGinis opened this issue Aug 28, 2024 · 1 comment

Comments

@TJGinis
Copy link

TJGinis commented Aug 28, 2024

Using the agnostic selector "//" in an xpath query along with the wildcard selector "*" will result in the query appearing to be a comment. Without this extension VSCode will properly identify the query (not as a comment).

Ex:

const $x= (xpath, contextNode = document) =>  document.evaluate(xpath, contextNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
const _$ = (textContent) => $x(`//*[text()="${textContent}"]`);  /*everything to the right of "//*" is shown in bright green*/
@TJGinis TJGinis changed the title Comments are not ignored when using xpath XPath treated as a comment when using better-comments Aug 28, 2024
@TJGinis
Copy link
Author

TJGinis commented Aug 28, 2024

The workaround I'm using for now is to use a template literal inside of a template literal and enclose the forward slashes:
${//}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant