-
Notifications
You must be signed in to change notification settings - Fork 48
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: allow custom optional closed tags #47
Comments
This might be related to issue #34 |
Perhaps this feature could take an array to explicitly enumerate options but also a function so that people can use conventions such as checking for the presence of a capital letter as is common in react land? I also think we could rework the parser so self-closing tags don't search for a closing element. |
@substack re-work the parser, and make the policy strict: You could then remove all this: |
@substack this would also speed up parsing times due to not having to test through this large string everytime. |
@substack how would I go about implementing this, any directions, I could do a branch and PR? |
In react a custom component can be notated like this:
<MyCustomComponent />
, in hyperx you have to notate is like this<MyCustomComponent><MyCustomComponent>
.I would like to notate optionally closable, non-html tags that could or could not be closed at the end.
So I would register with hyperx these in opts, under
optionallySelfClosing: []
. If they are closed (i.e. ending with/>
) then they are treated as closed tags. If they are not (i.e. ending in>
) then they have children and are not yet closed.Another way would be to have a
loose
setting inopts
. Where any tag, html or otherwise could be optional open or closed. However, this seems like more work to implement.The text was updated successfully, but these errors were encountered: