fix issue where lists that didn't start at 1 were not respected (#116)

This commit is contained in:
R. Aidan Campbell
2021-08-12 03:45:29 +02:00
committed by GitHub
parent 8ea7b1c86c
commit 49f2da7fed
5 changed files with 21 additions and 1 deletions
+2 -1
View File
@@ -7,12 +7,13 @@ import (
// An ItemElement is used to render items inside a list.
type ItemElement struct {
IsOrdered bool
Enumeration uint
}
func (e *ItemElement) Render(w io.Writer, ctx RenderContext) error {
var el *BaseElement
if e.Enumeration > 0 {
if e.IsOrdered {
el = &BaseElement{
Style: ctx.options.Styles.Enumeration,
Prefix: strconv.FormatInt(int64(e.Enumeration), 10),