parent
f6bda9ae89
commit
7440393d3a
1 changed files with 6 additions and 0 deletions
|
|
@ -45,6 +45,10 @@ type
|
||||||
keygen, output, progress, meter,
|
keygen, output, progress, meter,
|
||||||
details, summary, command, menu
|
details, summary, command, menu
|
||||||
|
|
||||||
|
const selfClosing = {area, base, br, col, embed, hr, img, input,
|
||||||
|
link, meta, param, source, track, wbr}
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
EventKind* {.pure.} = enum ## The events supported by the virtual DOM.
|
EventKind* {.pure.} = enum ## The events supported by the virtual DOM.
|
||||||
onclick, ## An element is clicked.
|
onclick, ## An element is clicked.
|
||||||
|
|
@ -434,6 +438,8 @@ proc add*(result: var string, n: VNode, indent = 0, indWidth = 2) =
|
||||||
result.add("</")
|
result.add("</")
|
||||||
result.add(kind)
|
result.add(kind)
|
||||||
result.add(">")
|
result.add(">")
|
||||||
|
elif n.kind in selfClosing:
|
||||||
|
result.add(" />")
|
||||||
else:
|
else:
|
||||||
result.add(">")
|
result.add(">")
|
||||||
result.add("</")
|
result.add("</")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue