Matt Basta <bastaw...@gmail.com> added the comment:

The number of problems produced by this bug can be greatly reduced by adding a 
relatively small check to the parser. Currently, <script> and <style> tags call 
set_cdata_mode(), which sets self.interesting to HTMLParser.interesting_cdata. 
This is bad because it searches for ANY closing tag, rather than a closing tag 
which matches the opening tag.

Alexander's fix solved about half the problem, but it didn't handle ending tags 
as text. I've fixed this and added some tests.

This is my first patch, so if there's a better way that I could be submitting 
this, input would be appreciated.

----------
nosy: +Matt.Basta
Added file: http://bugs.python.org/file22767/hp_fix.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue670664>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to