File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -456,18 +456,20 @@ proc xml2Tag*(xml: XmlNode): TagRef =
456456
457457proc xmlTree2Tag * (current, parent: TagRef , tree: XmlNode ) =
458458 let tag = tree.xml2Tag ()
459- if not tag.isNil ():
460- current.add (tag)
461459 if tree.kind == xnElement:
462460 for child in tree.items:
463461 tag.xmlTree2Tag (current, child)
462+ if not tag.isNil ():
463+ current.add (tag)
464464
465465
466466proc tagFromString * (source: string ): TagRef {.inline .} =
467467 # # Translates raw HTML string into TagRef
468468 let xmlNode = parseHtml (source)
469469 result = initTag (" div" , @ [], true )
470+ # for child in xmlNode:
470471 result .xmlTree2Tag (nil , xmlNode)
472+ # result.xmlTree2Tag(nil, xmlNode)
471473 when defined (js):
472474 result = result .children[0 ].children[0 ].TagRef
473475 else :
Original file line number Diff line number Diff line change 33 ../ src/ happyx
44
55
6+ var html =
7+ buildHtml (tDiv):
8+ rawHtml: """
9+ <div>
10+ <input type="password" />
11+ <hr>
12+ <script>
13+ var x = "Hello, world!";
14+ </script>
15+ </div>
16+ """
17+
18+ echo html
19+
20+
621# Declare application with ID "app"
722appRoutes " app" :
823 " /page1" :
You can’t perform that action at this time.
0 commit comments