Add support for ignoring < inside stop nodes #499
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.
This is useful for parsing
since without it, the < is treated as a new tag. This causes the parser to throw an exception when it cannot find a corresponding > to close the tag
Purpose / Goal
Ideally I'd like to use this library to parse a small subset of HTML, and one of the problems I found with it is that it unfortunately doesn't handle
<
in script tags particularly well.Currently it treats
<
as the start of an open tag, then looks for a corresponding>
to close that tag. Sometimes this is a desirable feature to have -- like when parsing<pre>
tags, the contents should still be valid HTML.It's just
<script>
that is the odd ball here. This is also why it cannot simply be applied to alloptions.stopNodes
, so a new options field had to be added. I went withoptions.ignoreTagsInNodes
though I am not attached to that name at all, if you have a better one, please change it :)Type
Please mention the type of PR
Bookmark this repository for further updates.