Skip to content

Commit

Permalink
Revert "Use MapSet for self_closing_tags"
Browse files Browse the repository at this point in the history
This reverts commit 5339fa3.
  • Loading branch information
ypconstante committed Jan 4, 2024
1 parent 5339fa3 commit 4d53e0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/floki/raw_html.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ defmodule Floki.RawHTML do
_ -> :noop
end

self_closing_tags = MapSet.new(self_closing_tags())
self_closing_tags = self_closing_tags()

IO.iodata_to_binary(build_raw_html(html_tree, [], encoder, padding, self_closing_tags))
end
Expand Down Expand Up @@ -143,7 +143,7 @@ defmodule Floki.RawHTML do
]

defp close_open_tag(type, [], self_closing_tags) do
if MapSet.member?(self_closing_tags, type) do
if type in self_closing_tags do
"/>"
else
">"
Expand All @@ -153,7 +153,7 @@ defmodule Floki.RawHTML do
defp close_open_tag(_type, _children, _self_closing_tags), do: ">"

defp close_end_tag(type, [], padding, self_closing_tags) do
if MapSet.member?(self_closing_tags, type) do
if type in self_closing_tags do
[]
else
[leftpad(padding), "</", type, ">", line_ending(padding)]
Expand Down

0 comments on commit 4d53e0f

Please sign in to comment.