Add support for ignoring < inside stop nodes#499
Open
nullcatalyst wants to merge 1 commit intoNaturalIntelligence:masterfrom
Open
Add support for ignoring < inside stop nodes#499nullcatalyst wants to merge 1 commit intoNaturalIntelligence:masterfrom
nullcatalyst wants to merge 1 commit intoNaturalIntelligence:masterfrom
Conversation
This is useful for parsing
```
<script>if (a < b) {}</script>
```
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
Member
|
Let me understand your changes. I'll try to respond as soon as possible from my side. |
Member
|
Probably, we can rename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.ignoreTagsInNodesthough 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.