mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-05 16:37:19 -04:00
Keep termenv profile in RenderContext
This commit is contained in:
+5
-5
@@ -46,7 +46,7 @@ func (e *TableElement) Render(w io.Writer, ctx RenderContext) error {
|
||||
iw := &indent.Writer{
|
||||
Indent: indentation + margin,
|
||||
IndentFunc: func(wr io.Writer) {
|
||||
renderText(w, bs.Current().Style.StylePrimitive, " ")
|
||||
renderText(w, ctx.colorProfile, bs.Current().Style.StylePrimitive, " ")
|
||||
},
|
||||
Forward: &ansi.Writer{
|
||||
Forward: w,
|
||||
@@ -56,8 +56,8 @@ func (e *TableElement) Render(w io.Writer, ctx RenderContext) error {
|
||||
style := bs.With(rules.StylePrimitive)
|
||||
ctx.table.styleWriter = NewStyleWriter(ctx, iw, style)
|
||||
|
||||
renderText(w, bs.Current().Style.StylePrimitive, rules.BlockPrefix)
|
||||
renderText(ctx.table.styleWriter, style, rules.Prefix)
|
||||
renderText(w, ctx.colorProfile, bs.Current().Style.StylePrimitive, rules.BlockPrefix)
|
||||
renderText(ctx.table.styleWriter, ctx.colorProfile, style, rules.Prefix)
|
||||
ctx.table.writer = tablewriter.NewWriter(ctx.table.styleWriter)
|
||||
return nil
|
||||
}
|
||||
@@ -79,8 +79,8 @@ func (e *TableElement) Finish(w io.Writer, ctx RenderContext) error {
|
||||
ctx.table.writer.Render()
|
||||
ctx.table.writer = nil
|
||||
|
||||
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.colorProfile, ctx.blockStack.With(rules.StylePrimitive), rules.Suffix)
|
||||
renderText(ctx.table.styleWriter, ctx.colorProfile, ctx.blockStack.Current().Style.StylePrimitive, rules.BlockSuffix)
|
||||
return ctx.table.styleWriter.Close()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user