diff --git a/lib/phlex/sgml.rb b/lib/phlex/sgml.rb index ec501fcd..3fb74572 100644 --- a/lib/phlex/sgml.rb +++ b/lib/phlex/sgml.rb @@ -502,6 +502,14 @@ def __nested_tokens__(tokens) else buffer << token.to_s end + when Array + if token.length > 0 + if i > 0 + buffer << " " << __nested_tokens__(token) + else + buffer << __nested_tokens__(token) + end + end when nil # Do nothing else diff --git a/quickdraw/sgml/attributes.test.rb b/quickdraw/sgml/attributes.test.rb index c1e3ac0d..e96040c7 100644 --- a/quickdraw/sgml/attributes.test.rb +++ b/quickdraw/sgml/attributes.test.rb @@ -258,6 +258,24 @@ ) == %(
) end +test "_, Array(String | Array)" do + expect( + phlex { div(attribute: ["hello", ["world"]]) }, + ) == %(
) +end + +test "_, Array(Array | String)" do + expect( + phlex { div(attribute: [["hello"], "world"]) }, + ) == %(
) +end + +test "_, Array(String | EmptyArray)" do + expect( + phlex { div(attribute: ["hello", []]) }, + ) == %(
) +end + test "_, Array(*invalid*)" do expect { phlex { div(attribute: [Object.new]) }