File tree 2 files changed +19
-2
lines changed
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 =
456
456
457
457
proc xmlTree2Tag * (current, parent: TagRef , tree: XmlNode ) =
458
458
let tag = tree.xml2Tag ()
459
- if not tag.isNil ():
460
- current.add (tag)
461
459
if tree.kind == xnElement:
462
460
for child in tree.items:
463
461
tag.xmlTree2Tag (current, child)
462
+ if not tag.isNil ():
463
+ current.add (tag)
464
464
465
465
466
466
proc tagFromString * (source: string ): TagRef {.inline .} =
467
467
# # Translates raw HTML string into TagRef
468
468
let xmlNode = parseHtml (source)
469
469
result = initTag (" div" , @ [], true )
470
+ # for child in xmlNode:
470
471
result .xmlTree2Tag (nil , xmlNode)
472
+ # result.xmlTree2Tag(nil, xmlNode)
471
473
when defined (js):
472
474
result = result .children[0 ].children[0 ].TagRef
473
475
else :
Original file line number Diff line number Diff line change 3
3
../ src/ happyx
4
4
5
5
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
+
6
21
# Declare application with ID "app"
7
22
appRoutes " app" :
8
23
" /page1" :
You can’t perform that action at this time.
0 commit comments