From 544fe9741dc2957d3e157a3210c8440d4ca94918 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 10 Dec 2019 18:14:37 +0100 Subject: [PATCH] Avoid unnecessary converions --- codeblock.go | 2 +- heading.go | 2 +- image.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codeblock.go b/codeblock.go index 53ee1a5..4f4ee08 100644 --- a/codeblock.go +++ b/codeblock.go @@ -44,7 +44,7 @@ func (e *CodeBlockElement) Render(w io.Writer, ctx RenderContext) error { // fallback rendering el := &BaseElement{ - Token: string(e.Code), + Token: e.Code, Style: rules, } diff --git a/heading.go b/heading.go index 1b9793e..a55e5f0 100644 --- a/heading.go +++ b/heading.go @@ -58,7 +58,7 @@ func (e *HeadingElement) Render(w io.Writer, ctx RenderContext) error { } el := &BaseElement{ Prefix: pre, - Token: string(e.Text), + Token: e.Text, Style: rules, } err := el.Render(flow, ctx) diff --git a/image.go b/image.go index a41833b..b993905 100644 --- a/image.go +++ b/image.go @@ -24,7 +24,7 @@ func (e *ImageElement) Render(w io.Writer, ctx RenderContext) error { } if len(e.URL) > 0 { el := &BaseElement{ - Token: resolveRelativeURL(e.BaseURL, string(e.URL)), + Token: resolveRelativeURL(e.BaseURL, e.URL), Prefix: " ", Style: ctx.style[Image], }