Decode style JSON into a typed struct

This commit is contained in:
Christian Muehlhaeuser
2019-12-13 03:04:48 +01:00
parent 219f21c4e7
commit 35342a2061
17 changed files with 184 additions and 249 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ func (e *LinkElement) Render(w io.Writer, ctx RenderContext) error {
el := &BaseElement{
Token: e.Text,
Style: ctx.style[LinkText],
Style: ctx.styles.LinkText,
}
err := el.Render(w, ctx)
if err != nil {
@@ -53,7 +53,7 @@ func (e *LinkElement) Render(w io.Writer, ctx RenderContext) error {
if len(e.URL) > 0 {
pre := " "
style := ctx.style[Link]
style := ctx.styles.Link
if !textRendered {
pre = ""
style.Prefix = ""