diff --git a/ansi/blockelement.go b/ansi/blockelement.go index aab9c102..625b886f 100644 --- a/ansi/blockelement.go +++ b/ansi/blockelement.go @@ -28,7 +28,7 @@ func (e *BlockElement) Render(w io.Writer, ctx RenderContext) error { func (e *BlockElement) Finish(w io.Writer, ctx RenderContext) error { bs := ctx.blockStack blockBuffer := bs.Current().Block - ls := e.Style.Style().Width(ctx.options.WordWrap) + ls := e.Style.Style().Inherit(e.Style.StylePrimitive.Style()).Width(ctx.options.WordWrap) _, err := w.Write([]byte(ls.Render(blockBuffer.String()))) if err != nil { diff --git a/ansi/elements.go b/ansi/elements.go index 2624d9f0..00939380 100644 --- a/ansi/elements.go +++ b/ansi/elements.go @@ -292,7 +292,7 @@ func (tr *ANSIRenderer) NewElement(node ast.Node, source []byte) Element { // n := node.(*ast.CodeSpan) e := &BlockElement{ Block: &bytes.Buffer{}, - Style: ctx.blockStack.Current().Style, + Style: ctx.options.Styles.Code, } return Element{ Renderer: e,