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

[feature-request] Ignore validation for certain values #415

Open
CatchABus opened this issue Jan 6, 2022 · 5 comments
Open

[feature-request] Ignore validation for certain values #415

CatchABus opened this issue Jan 6, 2022 · 5 comments
Labels
bug good first issue Pending Pending to be confirmed by user/author for some check/update/implementation

Comments

@CatchABus
Copy link

Description

It would be great if validator skipped certain expressions.

A case I noticed this could be useful is a framework that allows using javascript expressions as attribute values in XML.
The format is usually like this:

<tagName value="5" text="{{ isVisible && isEditable }}"/>
<tagName value="5" text="{{ array.length > 5 }}"/>

As you can see, there is the case of using XML special characters for different functionality.
I wonder if validator could be instructed to skip validation of attribute values using a regular expression.

@github-actions
Copy link

github-actions bot commented Jan 6, 2022

I'm glad you find this repository helpful. I'll try to address your issue ASAP. You can watch the repo for new changes or star it.

@amitguptagwl
Copy link
Member

I believe the only issue here is >, right?

@CatchABus
Copy link
Author

CatchABus commented Jan 7, 2022

I believe the only issue here is >, right?

Thank you very much for your fast reply! It seems that none of them is the issue, though I wonder if validator should complain about both. Ampersand is also a special symbol and perhaps validator should not allow ampersand after ampersand.
Regarding both cases, I didn't notice but I had also included quotes inside quotes in my own code and validator failed so I assumed it was special characters.

Validator can validate both cases.

@amitguptagwl
Copy link
Member

Validator is not giving error for both of the examples currently. So, yes, it is a bug. And I believe it's quite easy to fix.

@amitguptagwl
Copy link
Member

I'm leaving the bug open for sometimes, if someone want to try to fix it. Changes are required in validator.js:322. I believe current regular expression can't be fixed. So the function tagExpWithClosingIndex() from OrderedObjParser.js can be referred.

I'm even wondering if the validator code slowly can be merged to parser. 🤔

@amitguptagwl amitguptagwl added the Pending Pending to be confirmed by user/author for some check/update/implementation label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Pending Pending to be confirmed by user/author for some check/update/implementation
Projects
None yet
Development

No branches or pull requests

2 participants