package list import ( "html" "strconv" "strings" ) // RenderHTML renders the List in the HTML format. Example: // func (l *List) RenderHTML() string { l.initForRender() var out strings.Builder if len(l.items) > 0 { l.htmlRenderRecursively(&out, 0, l.items[0]) } return l.render(&out) } func (l *List) htmlRenderRecursively(out *strings.Builder, idx int, item *listItem) int { linePrefix := strings.Repeat(" ", item.Level) out.WriteString(linePrefix) out.WriteString("") return numItemsRendered }