Skip to content

Commit

Permalink
Add another whitespace preservation test
Browse files Browse the repository at this point in the history
Refs #28.
  • Loading branch information
matthiask committed Jan 3, 2024
1 parent 6c467a4 commit aec2304
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions html_sanitizer/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,3 +617,24 @@ def test_img_tag(self):
)

self.run_tests(entries, sanitizer=sanitizer)

def test_code_whitespace(self):
sanitizer = Sanitizer(
{
"tags": {"code"},
"empty": set(),
"separate": set(),
"attributes": {},
"keep_typographic_whitespace": True,
}
)

html = """\
<code>
git status
git add
git commit
</code>
"""

self.run_tests([(html, html)], sanitizer=sanitizer)

0 comments on commit aec2304

Please sign in to comment.