Fixed parsing of an HTML tag as the first thing inside a <script>. #56

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant
@papandreou
Contributor

papandreou commented Sep 14, 2012

Hi!

When a <script> contains something that looks like markup as the first token, the < is not included in element.raw and element.data. This causes problems when parsing templates that use the type='text/html' hack, for example:

<html>
<body>
    <script type='text/html'><div></div></script>
</body>
</html>

... which makes the Text element come out as div></div>.

The above is also included as a test case.

I ran into this issue with jsdom, which still uses htmlparser 1.x.

@papandreou

This comment has been minimized.

Show comment
Hide comment
@papandreou

papandreou Mar 5, 2013

Contributor

@tautologistics: Any chance of getting this merged?

Contributor

papandreou commented Mar 5, 2013

@tautologistics: Any chance of getting this merged?

AndreasMadsen referenced this pull request in AndreasMadsen/htmlparser2 Jul 31, 2013

@papandreou

This comment has been minimized.

Show comment
Hide comment
@papandreou

papandreou Oct 17, 2014

Contributor

Never mind, all the software I care about is using other parsers by now.

Contributor

papandreou commented Oct 17, 2014

Never mind, all the software I care about is using other parsers by now.

@papandreou papandreou closed this Oct 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment