(stack []*VDomElem)
| 57 | } |
| 58 | |
| 59 | func finalizeStack(stack []*VDomElem) *VDomElem { |
| 60 | if len(stack) == 0 { |
| 61 | return nil |
| 62 | } |
| 63 | for len(stack) > 1 { |
| 64 | stack = popElemStack(stack) |
| 65 | } |
| 66 | rtnElem := stack[0] |
| 67 | if len(rtnElem.Children) == 0 { |
| 68 | return nil |
| 69 | } |
| 70 | if len(rtnElem.Children) == 1 { |
| 71 | return &rtnElem.Children[0] |
| 72 | } |
| 73 | return rtnElem |
| 74 | } |
| 75 | |
| 76 | // returns value, isjson |
| 77 | func getAttrString(token htmltoken.Token, key string) string { |