Current section

86 Versions

Jump to

Compare versions

4 files changed
+10 additions
-7 deletions
  @@ -106,7 +106,7 @@ After setup Rust, you need to add `html5ever` NIF to your dependency list:
106 106 defp deps do
107 107 [
108 108 {:floki, "~> 0.20.0"},
109 - {:html5ever, "~> 0.5.0"}
109 + {:html5ever, "~> 0.6.1"}
110 110 ]
111 111 end
112 112 ```
  @@ -36,4 +36,4 @@
36 36 {<<"optional">>,false},
37 37 {<<"repository">>,<<"hexpm">>},
38 38 {<<"requirement">>,<<"~> 2.15">>}]]}.
39 - {<<"version">>,<<"0.20.2">>}.
39 + {<<"version">>,<<"0.20.3">>}.
  @@ -93,11 +93,14 @@ defmodule Floki.RawHTML do
93 93
94 94 defp build_attrs(attr, attrs), do: "#{attrs} #{attr}"
95 95
96 - defp tag_for(type, attrs, content, _encoder) when type in ["script", "style"] do
97 - tag_with_attrs(type, attrs, []) <> Enum.join(content) <> "</#{type}>"
98 - end
99 -
100 96 defp tag_for(type, attrs, children, encoder) do
97 + encoder =
98 + case type do
99 + "script" -> & &1
100 + "style" -> & &1
101 + _ -> encoder
102 + end
103 +
101 104 tag_with_attrs(type, attrs, children) <>
102 105 build_raw_html(children, "", encoder) <> close_end_tag(type, children)
103 106 end
  @@ -2,7 +2,7 @@ defmodule Floki.Mixfile do
2 2 use Mix.Project
3 3
4 4 @description "Floki is a simple HTML parser that enables search for nodes using CSS selectors."
5 - @version "0.20.2"
5 + @version "0.20.3"
6 6
7 7 def project do
8 8 [