-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added conditional
escape
parameter to .content_str()
method.
- Loading branch information
1 parent
f7a5638
commit c130c69
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -799,3 +799,20 @@ def test_deep_copy(): | |
|
||
assert str(tag) == '<div param="1"><h1>test</h1></div>' | ||
assert str(new_tag) == '<div param="2"><h2>test</h2></div>' | ||
|
||
|
||
def test_weird_msg(): | ||
original_str = """<blockquote>Message-ID: <[email protected]></blockquote>""" | ||
dom = dhtmlparser3.parse(original_str) | ||
|
||
content = dom.find("blockquote")[0].content_str().strip() | ||
assert content == "Message-ID: <[email protected]>" | ||
|
||
content = dom.find("blockquote")[0].content_str(True).strip() | ||
assert content == "Message-ID: <[email protected]>" | ||
|
||
tag = dom.find("blockquote")[0] | ||
assert tag.to_string() == original_str | ||
|
||
assert tag.prettify().strip() == original_str | ||
|