diff --git a/pkg/parser/list_test.go b/pkg/parser/list_test.go index 207cc056..0217a29c 100644 --- a/pkg/parser/list_test.go +++ b/pkg/parser/list_test.go @@ -554,6 +554,54 @@ another fenced block } verify(GinkgoT(), expectedResult, actualContent, parser.Entrypoint("DocumentBlock")) }) + + It("labeled list with title", func() { + actualContent := `.Labeled, single-line +first term:: definition of the first term +second term:: definition of the second term` + expectedResult := types.LabeledList{ + Attributes: types.ElementAttributes{ + types.AttrTitle: "Labeled, single-line", + }, + Items: []types.LabeledListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + Term: "first term", + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: []types.InlineElements{ + { + types.StringElement{ + Content: "definition of the first term", + }, + }, + }, + }, + }, + }, + { + Attributes: types.ElementAttributes{}, + Level: 1, + Term: "second term", + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: []types.InlineElements{ + { + types.StringElement{ + Content: "definition of the second term", + }, + }, + }, + }, + }, + }, + }, + } + verify(GinkgoT(), expectedResult, actualContent, parser.Entrypoint("DocumentBlock")) + }) }) Context("unordered list", func() { diff --git a/pkg/renderer/html5/labeled_list.go b/pkg/renderer/html5/labeled_list.go index 2d5faa2f..1b2afa46 100644 --- a/pkg/renderer/html5/labeled_list.go +++ b/pkg/renderer/html5/labeled_list.go @@ -17,7 +17,8 @@ var horizontalLabeledListTmpl texttemplate.Template func init() { defaultLabeledListTmpl = newTextTemplate("labeled list with default layout", `{{ $ctx := .Context }}{{ with .Data }}
something simple
definition of the first term
+definition of the second term
+