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,