Skip to content

Commit

Permalink
handle kw syntax for keys ending with '!'
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Oct 23, 2023
1 parent b31d573 commit 57a065d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Stipple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -927,9 +927,10 @@ function attributes(kwargs::Union{Vector{<:Pair}, Base.Iterators.Pairs, Dict},
end

v_isa_jsexpr = v isa Symbol || !isa(v, Union{AbstractString, Bool, Number})
attr_key = string((v_isa_jsexpr && ! startswith(string(k), ":") &&
! ( startswith(string(k), "v-") || startswith(string(k), "v" * Genie.config.html_parser_char_dash) ) ? ":" : ""), "$k") |> Symbol
attr_val = if isa(v, Symbol) && ! startswith(string(k), ":")
k_str = string(k)
attr_key = string((v_isa_jsexpr && ! startswith(k_str, ":") &&
! (endswith(k_str, "!") || startswith(k_str, "v-") || startswith(k_str, "v" * Genie.config.html_parser_char_dash)) ? ":" : ""), "$k") |> Symbol
attr_val = if isa(v, Symbol) && ! startswith(k_str, ":")
Stipple.julia_to_vue(v)
elseif v isa Symbol || ! v_isa_jsexpr
v
Expand Down

0 comments on commit 57a065d

Please sign in to comment.