mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-05 08:27:18 -04:00
Support rendering definition lists
This commit is contained in:
+27
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user