mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 08:57:14 -04:00
Use ElementStyle as a value instead of pointer, so we can drop all the annoying nil checks
This commit is contained in:
@@ -29,17 +29,14 @@ func (e *ListElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer) error
|
||||
func (e *ListElement) Finish(w io.Writer, node *bf.Node, tr *TermRenderer) error {
|
||||
var indent uint
|
||||
var margin uint
|
||||
var suffix string
|
||||
rules := tr.blockStack.Current().Style
|
||||
if rules != nil {
|
||||
if rules.Indent != nil {
|
||||
indent = *rules.Indent
|
||||
}
|
||||
if rules.Margin != nil {
|
||||
margin = *rules.Margin
|
||||
}
|
||||
suffix = rules.Suffix
|
||||
if rules.Indent != nil {
|
||||
indent = *rules.Indent
|
||||
}
|
||||
if rules.Margin != nil {
|
||||
margin = *rules.Margin
|
||||
}
|
||||
suffix := rules.Suffix
|
||||
renderText(tr.blockStack.Current().Block, rules, suffix)
|
||||
|
||||
pw := &PaddingWriter{
|
||||
|
||||
Reference in New Issue
Block a user