mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 00:47:15 -04:00
Let style define the indentation token
This commit is contained in:
+6
-1
@@ -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,
|
||||||
|
|||||||
+3
-2
@@ -31,8 +31,9 @@ type StyleTask struct {
|
|||||||
|
|
||||||
type StyleBlock struct {
|
type StyleBlock struct {
|
||||||
StylePrimitive
|
StylePrimitive
|
||||||
Indent *uint `json:"indent"`
|
Indent *uint `json:"indent"`
|
||||||
Margin *uint `json:"margin"`
|
IndentToken *string `json:"indent_token"`
|
||||||
|
Margin *uint `json:"margin"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StyleCodeBlock struct {
|
type StyleCodeBlock struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user