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

Option to allow any element as self-closing #99

Closed
sergey-v9 opened this issue Jun 4, 2022 · 1 comment · Fixed by #109
Closed

Option to allow any element as self-closing #99

sergey-v9 opened this issue Jun 4, 2022 · 1 comment · Fixed by #109
Labels
enhancement New feature or request

Comments

@sergey-v9
Copy link

I am trying to adopt your linter in our project to validate small HTML-like template files and found that it has no option to allow any element to be self-closing.
I khow it is a non-standard HTML syntax (more like an XML Empty-element tags), but this is what we have in our templates.

Would you mind adding a way to solve this? Maybe another option for the require-closing-tags rule in addition to selfClosing? Or do you prefer to stick with HTML standard syntax?

playground example with warning

<div>
    <custom-tag />
    <div>
    </div>
</div>
@yeonjuan yeonjuan added the enhancement New feature or request label Jun 5, 2022
@yeonjuan
Copy link
Owner

yeonjuan commented Jun 5, 2022

@sergey-v9 Hi, Thanks for the new issue.
I agree about the feature but it's hard to implement it quickly.
Our parser follows standard HTML syntax which does not allow self-closing for custom elements so it's hard to handle at the linter level.

P.S.
For solving these kinds of problems, I'm developing a new HTML parser that relaxes some restrictions. (https://github.com/yeonjuan/sa-html-parser).

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

Successfully merging a pull request may close this issue.

2 participants