Open anicolao opened 2 years ago
The following hack does work around the problem:
diff --git a/ansi/margin.go b/ansi/margin.go
index e039783..4e1992f 100644
--- a/ansi/margin.go
+++ b/ansi/margin.go
@@ -29,10 +29,10 @@ func NewMarginWriter(ctx RenderContext, w io.Writer, rules StyleBlock) *MarginWr
}
pw := padding.NewWriterPipe(w, bs.Width(ctx), func(wr io.Writer) {
- renderText(w, ctx.options.ColorProfile, rules.StylePrimitive, " ")
+ renderText(w, ctx.options.ColorProfile, rules.StylePrimitive, "\u200b ")
})
- ic := " "
+ ic := "\u200b "
if rules.IndentToken != nil {
ic = *rules.IndentToken
}
To reproduce:
The output of
glow
should have a two space margin. The margin appears only before lines which have colour in them, like headers, and not before other lines.