Skip to content

Commit

Permalink
adds failing test for issue rrrene#62
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimeiniesta committed Oct 29, 2024
1 parent 4de9ce3 commit 6ddd1bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/custom_scrubber_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ defmodule CustomScrubberTest do
Meta.strip_comments()

Meta.allow_tag_with_any_attributes("p")
Meta.allow_tag_with_uri_attributes("a", ["href"], ["https", "mailto"])

Meta.allow_tags_with_style_attributes(["span", "html", "body"])

Expand All @@ -23,9 +24,9 @@ defmodule CustomScrubberTest do

test "strips everything except the allowed tags (for multiple tags)" do
input =
"<section><header><script>code!</script></header><p>hello <script>code!</script></p></section>"
"<section><header><script>code!</script></header><p>hello <script>code!</script><a href=\"https://example.com\">link</a></p></section>"

expected = "code!<p>hello code!</p>"
expected = "code!<p>hello code!<a href=\"https://example.com\">link</a></p>"
assert expected == scrub(input)
end
end

0 comments on commit 6ddd1bf

Please sign in to comment.