MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / tokenToElem

Function tokenToElem

pkg/vdom/vdom_html.go:129–142  ·  view source on GitHub ↗
(token htmltoken.Token, params map[string]any)

Source from the content-addressed store, hash-verified

127}
128
129func tokenToElem(token htmltoken.Token, params map[string]any) *VDomElem {
130 elem := &VDomElem{Tag: token.Data}
131 if len(token.Attr) > 0 {
132 elem.Props = make(map[string]any)
133 }
134 for _, attr := range token.Attr {
135 if attr.Key == "" || attr.Val == "" {
136 continue
137 }
138 propVal := attrToProp(attr.Val, attr.IsJson, params)
139 elem.Props[attr.Key] = propVal
140 }
141 return elem
142}
143
144func isWsChar(char rune) bool {
145 return char == ' ' || char == '\t' || char == '\n' || char == '\r'

Callers 1

BindFunction · 0.85

Calls 1

attrToPropFunction · 0.85

Tested by

no test coverage detected