Allow wildcard close tag for block elements #20
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As noted in #11 (does not close, but adds functionality discussed)
Currently, while permitted, it is inconvenient to use blocks as element open tag names. You must make sure the close block matches exactly.
This is inconvenient if you want to do anything non trivial in one of these blocks.
The changes in this pull request allow you to do the following instead.
The enabling, and exact syntax of the wildcard, is configurable via a config option:
The above is included as an example in the documentation for enabling
</_>
wildcards, though I am certain others may be desirable. The sample above is general enough that simply by modifying the wildcard close used in the config, one could set their wildcard close to anything they desire.When enabled, wildcards can only be used to close block element open tags (not other tags); but block element open tags can still be closed with a duplicate if desired. When disabled, behaviour is as currently implemented.