1.x: Fixed parsing of a tag as the first thing inside script #55

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

papandreou commented Sep 14, 2012

Hi!

When a <script> tag contains something that looks like markup as the first token, the < is not included from 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.

Contributor

papandreou commented Sep 14, 2012

Whoops, specified the wrong target branch

papandreou closed this Sep 14, 2012

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