Esempio n. 1
0
// html and htmlAll could be one func but heck I cba now.
func _html(ns Nodes, outer bool) string {
	if len(ns) == 0 {
		return ""
	}
	wr := w{}
	if outer {
		html.Render(&wr, ns[0].Node)
	} else {
		for _, v := range ns[0].Node.Child {
			html.Render(&wr, v)
		}
	}
	return wr.s
}
Esempio n. 2
0
func htmlAll(ns Nodes, outer bool) []string {
	sl := []string{}
	for _, v := range ns {
		wr := w{}
		if outer {
			html.Render(&wr, v.Node)
		} else {
			for _, c := range v.Child {
				html.Render(&wr, c)
			}
		}
		sl = append(sl, wr.s)
	}
	return sl
}