From c868abeeecd3e11d8902e498208ca82caacd2688 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 8 Dec 2019 16:47:36 +0100 Subject: [PATCH] Render indent of code_block and heading in current style --- codeblock.go | 2 +- heading.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codeblock.go b/codeblock.go index 1e9b74f..071575d 100644 --- a/codeblock.go +++ b/codeblock.go @@ -26,7 +26,7 @@ func (e *CodeBlockElement) Render(w io.Writer, ctx RenderContext) error { iw := &IndentWriter{ Indent: indent + margin, IndentFunc: func(wr io.Writer) { - renderText(w, ctx.blockStack.Parent().Style, " ") + renderText(w, ctx.blockStack.Current().Style, " ") }, Forward: &AnsiWriter{ Forward: w, diff --git a/heading.go b/heading.go index 492aa22..1b9793e 100644 --- a/heading.go +++ b/heading.go @@ -43,7 +43,7 @@ func (e *HeadingElement) Render(w io.Writer, ctx RenderContext) error { iw := &IndentWriter{ Indent: indent + margin, IndentFunc: func(wr io.Writer) { - renderText(w, bs.Parent().Style, " ") + renderText(w, bs.Current().Style, " ") }, Forward: &AnsiWriter{ Forward: w,