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 all options.stopNodes, so a new options field had to be added. I went with options.ignoreTagsInNodes though I am not attached to that name at all, if you have a better one, please change it :)
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.