HTMLParser has problems with html in script variables... #1

Open
jedie opened this Issue Jul 12, 2011 · 3 comments

Projects

None yet

1 participant

@jedie
jedie commented Jul 12, 2011
Response's content is no valid html: 'Unexpected end tag `p`

e.g.:

<script>
var js_sha_link='<p>***</p>';
</script>

or e.g.:

$("#preview_id_content div").html('<h2 class="noanchor">loading...</h2>');
jedie commented Jul 12, 2011

This is also not valid?

AssertionError: html code is not valid: Unexpected end tag `input` (Line 1, Column 49), at line 1, column 50 - code: '<input value="Foo" type="text" name="first_name"></input>'

Should i open a seperate issuse?

jedie commented Sep 7, 2011

This problem has other guys, too: django-compressor/django-compressor#60 ;)

The real problem is here: http://bugs.python.org/issue670664 and has pachtes...

jedie commented Sep 7, 2011

I tried http://bugs.python.org/file22767/hp_fix.diff from http://bugs.python.org/issue670664 and this seems to fix this issues!

I add the patch in my django-tools with: jedie/django-tools@aa722b3

@gregmuellegger gregmuellegger added a commit that referenced this issue Jan 27, 2012
@gregmuellegger Fixed issue #1: resolving stdlib's problems with parsing script tags …
…with obscure (not correctly escaped) html content.
9cf96a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment