element_base.go
func (e *elementBase) writeChildren(bf *bytes.Buffer) (int64, error) {
	l := len(e.children)
	for index, child := range e.children {
		if index == l-1 {
			child.SetLastChild(true)
		}

		if e.opts.formatter != nil {
			if i, err := e.opts.formatter.OpeningElement(bf, child); err != nil {
				return int64(i), err
			}
		}
		if i, err := child.WriteTo(bf); err != nil {
			return int64(i), err
		}
	}
	return 0, nil
}
func (e *elementBase) writeChildren(bf *bytes.Buffer) (int64, error) {
	l := len(e.children)
	for index, child := range e.children {
		if index == l-1 {
			child.SetLastChild(true)
		}

		if e.opts.formatter != nil {
			if i, err := e.opts.formatter.OpeningElement(bf, child); err != nil {
				return int64(i), err
			}
		}
		if i, err := child.WriteTo(bf); err != nil {
			return int64(i), err
		}
	}
	return 0, nil
}
// writeChildren writes the children's HTML.