Let style define the indentation token

This commit is contained in:
Christian Muehlhaeuser
2019-12-18 19:47:58 +01:00
parent 92cf159a89
commit be2762f3db
2 changed files with 9 additions and 3 deletions
+6 -1
View File
@@ -35,10 +35,15 @@ func NewMarginWriter(ctx RenderContext, w io.Writer, rules StyleBlock) *MarginWr
Forward: w, Forward: w,
}, },
} }
ic := " "
if rules.IndentToken != nil {
ic = *rules.IndentToken
}
iw := &indent.Writer{ iw := &indent.Writer{
Indent: indentation + margin, Indent: indentation + margin,
IndentFunc: func(wr io.Writer) { IndentFunc: func(wr io.Writer) {
renderText(w, bs.Parent().Style.StylePrimitive, " ") renderText(w, bs.Parent().Style.StylePrimitive, ic)
}, },
Forward: &ansi.Writer{ Forward: &ansi.Writer{
Forward: pw, Forward: pw,
+1
View File
@@ -32,6 +32,7 @@ type StyleTask struct {
type StyleBlock struct { type StyleBlock struct {
StylePrimitive StylePrimitive
Indent *uint `json:"indent"` Indent *uint `json:"indent"`
IndentToken *string `json:"indent_token"`
Margin *uint `json:"margin"` Margin *uint `json:"margin"`
} }