mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-08-28 04:46:29 -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,
|
||||
},
|
||||
}
|
||||
|
||||
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
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user