Commits

Alex Suraci committed 38811dd

simplifications
Ignore-this: 8e9bdfc807392a39d3d775f61a8723f8

  • Participants
  • Parent commits f1dfeb6

Comments (0)

Files changed (1)

         then: {
             attr-names = m particle names
             attr-values = m targets tail
-            attrs = attr-names zip: attr-values with: @->
+            attrs = attr-names zip: attr-values
             h attributes = h attributes .. attrs
         }
         else: {
             attr-names = m particle names tail
             attr-values = m targets (drop: 2)
 
-            attrs = attr-names zip: attr-values with: @->
+            attrs = attr-names zip: attr-values
 
             first = m particle names (at: 0)
             element = first (split-on: '.') head (split-on: '#') head
         " " .. a from .. "=\"" .. a to .. "\""
     }) join
 
-    if: (h tag empty?)
-        then: { c }
-        else: {
-            if: (c empty? && (Self-Closing contains?: h tag))
-                then: { "<" .. h tag .. attrs .. " />" }
-                else: {
-                    "<" .. h tag .. attrs .. ">" .. c .. "</" .. h tag .. ">"
-                }
-        }
+    condition: {
+        h tag empty? -> c
+
+        c empty? && (Self-Closing contains?: h tag) ->
+            "<" .. h tag .. attrs .. " />"
+
+        otherwise ->
+            "<" .. h tag .. attrs .. ">" .. c .. "</" .. h tag .. ">"
+    }
 } call