Support rendering definition lists

This commit is contained in:
Christian Muehlhaeuser
2019-12-13 03:00:45 +01:00
parent cc0738c20a
commit e310343e4a
3 changed files with 42 additions and 1 deletions
+27
View File
@@ -299,6 +299,33 @@ func (tr *TermRenderer) NewElement(node ast.Node, source []byte) Element {
},
}
// Definition Lists
case astext.KindDefinitionList:
e := &BlockElement{
Block: &bytes.Buffer{},
Style: cascadeStyle(ctx.blockStack.Current().Style, ctx.style[DefinitionList], true),
Margin: true,
}
return Element{
Entering: "\n",
Renderer: e,
Finisher: e,
}
case astext.KindDefinitionTerm:
return Element{
Renderer: &BaseElement{
Style: ctx.style[DefinitionTerm],
},
}
case astext.KindDefinitionDescription:
return Element{
Renderer: &BaseElement{
Style: ctx.style[DefinitionDescription],
},
}
// Handled by parents
case astext.KindTaskCheckBox:
// handled by KindListItem