Skip to content

Commit

Permalink
Merge pull request #95 from liveview-native/bc-fix-class-name-splitting
Browse files Browse the repository at this point in the history
Fix class name splitting
  • Loading branch information
bcardarella authored Dec 11, 2023
2 parents 4c4a80d + ca7c43a commit bf5d66d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/live_view_native/templates.ex
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,19 @@ defmodule LiveViewNative.Templates do
new_acc =
node
|> Floki.attribute("class")
|> split_class_names()
|> Enum.reduce(acc, fn(class_name, acc) ->
Map.put(acc, class_name, true)
end)

{nil, new_acc}
end

defp split_class_names([]), do: []
defp split_class_names([class_names | _tail]) do
String.split(class_names, " ")
end

defp module_has_stylesheet?(module) do
:functions
|> module.__info__()
Expand Down

0 comments on commit bf5d66d

Please sign in to comment.