               "
               tags             = (tag | close-tag | closed-tag | text)*
               close-tag        = <'</'> name <'>'>
-              closed-tag       = <'<'> name arg* <'/>'>
-              tag              = <'<'> name arg* <'>'>
-              arg              = arg-with-value | arg-no-value
-              arg-with-value   = name <'='> arg-value
-              arg-no-value     = name
-              arg-value        = <quote> #'[^\"]*' <quote>
+              closed-tag       = <'<'> name attr* <'/>'>
+              tag              = <'<'> name attr* <'>'>
+              attr              = attr-with-value | attr-no-value
+              attr-with-value   = name <'='> attr-value
+              attr-no-value     = name
+              attr-value        = <quote> #'[^\"]*' <quote>
               quote            = #'\"'
               name             = #'[a-zA-Z0-9!-]+'
               text             = #'[^<]*'

    s
    (str " " s)))

(def args [{:name "n1" :value "v1"} {:name "n3" :value nil} {:name "n2" :value "v2"}])
(args-to-string args)

(comment
  (parser "<hello>")

  (parser "<hello>world >>> xx bb</hello>")
  (parser template)
  (parser template-1)
  (let [nodes (tr/transform {:tags            (fun ([& rest] rest))
                             :close-tag       (fun
                                                ([[:name "fragment"]]
                                                  nil)
                                                ([[:name close-tag-name]]
                                                  [:text (str "</" close-tag-name ">")]))
                             :attr            (fn [attr] attr)
                             :attr-with-value (fun ([[:name name] [:attr-value attr-value]] {:name  name
                                                                                             :value attr-value}))
                             :attr-no-value   (fun ([[:name name]] {:name  name
                                                                    :value nil}))
                             :tag             (fun ([[:name "slot"] & attrs] {:slot (into {} attrs)})
                                                   ([[:name "fragment"] & attrs] {:fragment (into {} attrs)})
                                                   ([[:name tag-name] & attrs]
                                                     [:text (str "<" tag-name (add-leading-space
                                                                                (attrs-to-string attrs)) ">")]))
                             :closed-tag      (fun ([[:name "slot"] & attrs] {:slot (into {} attrs)})
                                                   ([[:name "fragment"] & attrs] {:fragment (into {} attrs)})
                                                   ([[:name tag-name] & attrs]
                                                     [:text (str "<" tag-name (add-leading-space
                                                                                (attrs-to-string attrs)) "/>")]))
                             }
                            (parser template-1))]

