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,
},
}
ic := " "
if rules.IndentToken != nil {
ic = *rules.IndentToken
}
iw := &indent.Writer{
Indent: indentation + margin,
IndentFunc: func(wr io.Writer) {
renderText(w, bs.Parent().Style.StylePrimitive, " ")
renderText(w, bs.Parent().Style.StylePrimitive, ic)
},
Forward: &ansi.Writer{
Forward: pw,
+3 -2
View File
@@ -31,8 +31,9 @@ type StyleTask struct {
type StyleBlock struct {
StylePrimitive
Indent *uint `json:"indent"`
Margin *uint `json:"margin"`
Indent *uint `json:"indent"`
IndentToken *string `json:"indent_token"`
Margin *uint `json:"margin"`
}
type StyleCodeBlock struct {