Skip to content

Commit

Permalink
Add failing test for white-space eating
Browse files Browse the repository at this point in the history
Reproduces #4

Thx to @smeevil for both the bug report and the term "white-space eating" :)
  • Loading branch information
rrrene committed Feb 24, 2016
1 parent 3c8ee52 commit 9bc5c97
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/basic_html_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ defmodule HtmlSanitizeExScrubberBasicHTMLTest do
HtmlSanitizeEx.basic_html(text)
end

test "strips nothing" do
input = "This <b>is</b> <b>an</b> <i>example</i> of <u>space</u> eating."
expected = "This <b>is</b> <b>an</b> <i>example</i> of <u>space</u> eating."
assert expected == basic_html_sanitize(input)
end

test "strips everything except the allowed tags" do
input = "<h1>hello <script>code!</script></h1>"
expected = "<h1>hello code!</h1>"
Expand Down

0 comments on commit 9bc5c97

Please sign in to comment.