@@ -60,6 +60,7 @@ public var media: String?
6060public var title : String ?
6161public var scope : String ?
6262public var classs : String ?
63+ public var manifest : String ?
6364public var value : String ?
6465public var clear : String ?
6566public var start : String ?
@@ -85,6 +86,7 @@ public var prompt: String?
8586public var onfocus : String ?
8687public var enctype : String ?
8788public var onclick : String ?
89+ public var ontouchstart : String ?
8890public var onkeyup : String ?
8991public var profile : String ?
9092public var version : String ?
@@ -131,6 +133,7 @@ public var onkeypress: String?
131133public var ondblclick : String ?
132134public var onmouseout : String ?
133135public var httpEquiv : String ?
136+ public var dataText : String ?
134137public var background : String ?
135138public var onmousemove : String ?
136139public var onmouseover : String ?
@@ -334,9 +337,9 @@ var scopesBuffer = [UInt64: String]()
334337
335338// swiftlint:disable cyclomatic_complexity function_body_length
336339private func evaluate( _ node: String , _ attrs: [ String : String ? ] = [ : ] , _ closure: Closure ) {
337-
340+
338341 // Push the attributes.
339-
342+
340343 let stackid = idd
341344 let stackdir = dir
342345 let stackrel = rel
@@ -377,6 +380,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
377380 let stacktitle = title
378381 let stackscope = scope
379382 let stackclass = classs
383+ let stackmanifest = manifest
380384 let stackvalue = value
381385 let stackclear = clear
382386 let stackstart = start
@@ -402,6 +406,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
402406 let stackonfocus = onfocus
403407 let stackenctype = enctype
404408 let stackonclick = onclick
409+ let stackontouchstart = ontouchstart
405410 let stackonkeyup = onkeyup
406411 let stackprofile = profile
407412 let stackversion = version
@@ -447,6 +452,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
447452 let stackondblclick = ondblclick
448453 let stackonmouseout = onmouseout
449454 let stackhttpEquiv = httpEquiv
455+ let stackdataText = dataText
450456 let stackbackground = background
451457 let stackonmousemove = onmousemove
452458 let stackonmouseover = onmouseover
@@ -459,9 +465,9 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
459465 let stackmarginheight = marginheight
460466 let stackacceptCharset = acceptCharset
461467 let stackinner = inner
462-
468+
463469 // Reset the values before a nested scope evalutation.
464-
470+
465471 idd = nil
466472 dir = nil
467473 rel = nil
@@ -502,6 +508,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
502508 title = nil
503509 scope = nil
504510 classs = nil
511+ manifest = nil
505512 value = nil
506513 clear = nil
507514 start = nil
@@ -527,6 +534,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
527534 onfocus = nil
528535 enctype = nil
529536 onclick = nil
537+ ontouchstart = nil
530538 onkeyup = nil
531539 profile = nil
532540 version = nil
@@ -572,6 +580,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
572580 ondblclick = nil
573581 onmouseout = nil
574582 httpEquiv = nil
583+ dataText = nil
575584 background = nil
576585 onmousemove = nil
577586 onmouseover = nil
@@ -584,25 +593,25 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
584593 marginheight = nil
585594 acceptCharset = nil
586595 inner = nil
587-
596+
588597 scopesBuffer [ Process . tid] = ( scopesBuffer [ Process . tid] ?? " " ) + " < " + node
589-
598+
590599 // Save the current output before the nested scope evalutation.
591-
600+
592601 var output = scopesBuffer [ Process . tid] ?? " "
593-
602+
594603 // Clear the output buffer for the evalutation.
595-
604+
596605 scopesBuffer [ Process . tid] = " "
597-
606+
598607 // Evaluate the nested scope.
599-
608+
600609 closure ( )
601-
610+
602611 // Render attributes set by the evalutation.
603-
612+
604613 var mergedAttributes = [ String: String? ] ( )
605-
614+
606615 if let idd = idd { mergedAttributes [ " id " ] = idd }
607616 if let dir = dir { mergedAttributes [ " dir " ] = dir }
608617 if let rel = rel { mergedAttributes [ " rel " ] = rel }
@@ -643,6 +652,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
643652 if let title = title { mergedAttributes [ " title " ] = title }
644653 if let scope = scope { mergedAttributes [ " scope " ] = scope }
645654 if let classs = classs { mergedAttributes [ " class " ] = classs }
655+ if let manifest = manifest { mergedAttributes [ " manifest " ] = manifest }
646656 if let value = value { mergedAttributes [ " value " ] = value }
647657 if let clear = clear { mergedAttributes [ " clear " ] = clear }
648658 if let start = start { mergedAttributes [ " start " ] = start }
@@ -668,6 +678,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
668678 if let onfocus = onfocus { mergedAttributes [ " onfocus " ] = onfocus }
669679 if let enctype = enctype { mergedAttributes [ " enctype " ] = enctype }
670680 if let onclick = onclick { mergedAttributes [ " onclick " ] = onclick }
681+ if let ontouchstart = ontouchstart { mergedAttributes [ " ontouchstart " ] = ontouchstart }
671682 if let onkeyup = onkeyup { mergedAttributes [ " onkeyup " ] = onkeyup }
672683 if let profile = profile { mergedAttributes [ " profile " ] = profile }
673684 if let version = version { mergedAttributes [ " version " ] = version }
@@ -713,6 +724,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
713724 if let ondblclick = ondblclick { mergedAttributes [ " ondblclick " ] = ondblclick }
714725 if let onmouseout = onmouseout { mergedAttributes [ " onmouseout " ] = onmouseout }
715726 if let httpEquiv = httpEquiv { mergedAttributes [ " http-equiv " ] = httpEquiv }
727+ if let dataText = dataText { mergedAttributes [ " data-text " ] = dataText }
716728 if let background = background { mergedAttributes [ " background " ] = background }
717729 if let onmousemove = onmousemove { mergedAttributes [ " onmousemove " ] = onmousemove }
718730 if let onmouseover = onmouseover { mergedAttributes [ " onmouseover " ] = onmouseover }
@@ -724,28 +736,28 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
724736 if let placeholder = placeholder { mergedAttributes [ " placeholder " ] = placeholder }
725737 if let marginheight = marginheight { mergedAttributes [ " marginheight " ] = marginheight }
726738 if let acceptCharset = acceptCharset { mergedAttributes [ " accept-charset " ] = acceptCharset }
727-
739+
728740 for item in attrs. enumerated ( ) {
729741 mergedAttributes. updateValue ( item. element. 1 , forKey: item. element. 0 )
730742 }
731-
743+
732744 output += mergedAttributes. reduce ( " " ) { result, item in
733745 if let value = item. value {
734746 return result + " \( item. key) = \" \( value) \" "
735747 } else {
736748 return result
737749 }
738750 }
739-
751+
740752 if let inner = inner {
741753 scopesBuffer [ Process . tid] = output + " > " + ( inner) + " </ " + node + " > "
742754 } else {
743755 let current = scopesBuffer [ Process . tid] ?? " "
744756 scopesBuffer [ Process . tid] = output + " > " + current + " </ " + node + " > "
745757 }
746-
758+
747759 // Pop the attributes.
748-
760+
749761 idd = stackid
750762 dir = stackdir
751763 rel = stackrel
@@ -786,6 +798,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
786798 title = stacktitle
787799 scope = stackscope
788800 classs = stackclass
801+ manifest = stackmanifest
789802 value = stackvalue
790803 clear = stackclear
791804 start = stackstart
@@ -811,6 +824,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
811824 onfocus = stackonfocus
812825 enctype = stackenctype
813826 onclick = stackonclick
827+ ontouchstart = stackontouchstart
814828 onkeyup = stackonkeyup
815829 profile = stackprofile
816830 version = stackversion
@@ -856,6 +870,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
856870 ondblclick = stackondblclick
857871 onmouseout = stackonmouseout
858872 httpEquiv = stackhttpEquiv
873+ dataText = stackdataText
859874 background = stackbackground
860875 onmousemove = stackonmousemove
861876 onmouseover = stackonmouseover
@@ -867,6 +882,6 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
867882 cellspacing = stackcellspacing
868883 marginheight = stackmarginheight
869884 acceptCharset = stackacceptCharset
870-
885+
871886 inner = stackinner
872887}
0 commit comments