Skip to content

Commit

Permalink
yaws_api: Fix ehtml {check, _, number()} attributes
Browse files Browse the repository at this point in the history
Attribute {check, Key, 10} should expand the same way as {Key, 10}.
  • Loading branch information
weisslj committed Aug 25, 2014
1 parent cbbbdbe commit b513bdd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/yaws_api.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,7 @@ ehtml_attrs([{check, Name, Value} | Tail]) ->
true -> $';
false -> $"
end,
ValueString = [Q,Value,Q],
ValueString = [Q,Val,Q],
[[$ |atom_to_list(Name)], [$=|ValueString]|ehtml_attrs(Tail)].


Expand Down
8 changes: 8 additions & 0 deletions test/eunit/ehtml_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ non_void_element_test() ->
P = "<p></p>",
P = lists:flatten(yaws_api:ehtml_expand(E)).

attributes_test() ->
{ehtml, E} = {ehtml, [{img, [{check, src, "quote\".png"},
{check, width, 10},
{height, 20},
{check, alt, "quote\""}]}]},
Img = "<img src='quote\".png' width=\"10\" height=\"20\" alt='quote\"' />",
Img = lists:flatten(yaws_api:ehtml_expand(E)).

get_title() ->
"Funtest Title".

Expand Down

0 comments on commit b513bdd

Please sign in to comment.