Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Fixed nasty bug which *could* cause invalid XML output.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bystroushaak committed Feb 16, 2015
1 parent 98221ac commit 26a8a7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

2.0.9
-----
- Fixed nasty bug which *could* cause invalid XML output.

2.0.8
-----
- Removed _repair_tags() - it wasn't really necessary.
Expand Down
6 changes: 4 additions & 2 deletions src/dhtmlparser/htmlelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,12 +884,14 @@ def isAlmostEqual(self, tag_name, params=None, fn=None,
if fn and not fn(self):
return False

# compare case sensitive?
comparator = self.__tagname # we need to make self.__tagname lower
if not case_sensitive and tag_name:
self.__tagname = self.__tagname.lower()
tag_name = tag_name.lower()
comparator = comparator.lower()

# compare tagname
if tag_name and tag_name != self.__tagname:
if tag_name and tag_name != comparator:
return False

# None params = don't use parameters to compare equality
Expand Down

0 comments on commit 26a8a7b

Please sign in to comment.