mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 00:47:15 -04:00
Fix TableElement not inheriting style from parent
This commit is contained in:
+4
-3
@@ -49,10 +49,11 @@ func (e *TableElement) Render(w io.Writer, ctx RenderContext) error {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.table.styleWriter = NewStyleWriter(ctx, iw, rules.StylePrimitive)
|
style := bs.With(rules.StylePrimitive)
|
||||||
|
ctx.table.styleWriter = NewStyleWriter(ctx, iw, style)
|
||||||
|
|
||||||
renderText(w, bs.Current().Style.StylePrimitive, rules.BlockPrefix)
|
renderText(w, bs.Current().Style.StylePrimitive, rules.BlockPrefix)
|
||||||
renderText(ctx.table.styleWriter, rules.StylePrimitive, rules.Prefix)
|
renderText(ctx.table.styleWriter, style, rules.Prefix)
|
||||||
ctx.table.writer = tablewriter.NewWriter(ctx.table.styleWriter)
|
ctx.table.writer = tablewriter.NewWriter(ctx.table.styleWriter)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -74,7 +75,7 @@ func (e *TableElement) Finish(w io.Writer, ctx RenderContext) error {
|
|||||||
ctx.table.writer.Render()
|
ctx.table.writer.Render()
|
||||||
ctx.table.writer = nil
|
ctx.table.writer = nil
|
||||||
|
|
||||||
renderText(ctx.table.styleWriter, rules.StylePrimitive, rules.Suffix)
|
renderText(ctx.table.styleWriter, ctx.blockStack.With(rules.StylePrimitive), rules.Suffix)
|
||||||
renderText(ctx.table.styleWriter, ctx.blockStack.Current().Style.StylePrimitive, rules.BlockSuffix)
|
renderText(ctx.table.styleWriter, ctx.blockStack.Current().Style.StylePrimitive, rules.BlockSuffix)
|
||||||
return ctx.table.styleWriter.Close()
|
return ctx.table.styleWriter.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user