-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Support for custom self-closing tags? #767
Comments
Ok, so I pointed to the wrong thing. Turns out I need to extend voidElements instead. Here's the commit I'm using to do this. If you'd like a PR, let me know. Or feel free to copy in the code yourself, no attribution needed. |
I am also trying to parse .svelte files which have custom self-closing tags and on top there can be props in the form |
@floratmin There is a fork of this project for Svelte: https://github.com/alexprey/htmlparser2 @gilbert How do you feel about having to extend the parser to get this functionality? I'm thinking about moving the check for a self-closing tag to a separate method, which you could override. |
@fb55 thank you to make me aware of this library, but same problem there. I reported it there. |
@fb55 Thats sounds great to me! |
Allows users to override this method and get custom void-element behavior. Fixes #767
Hi, would it be possible to provide a way for htmparser2 to expose an option to allow custom tags that auto self close? In other words, an option to extend this record? I'm working on an html-based framework and would like to allow users to write a
<page>
tag without worrying about whether they need to write</page>
or end with/>
.Thanks for the great library.
The text was updated successfully, but these errors were encountered: