mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 00:47:15 -04:00
Use ElementStyle as a value instead of pointer, so we can drop all the annoying nil checks
This commit is contained in:
@@ -35,8 +35,8 @@ func (e *LinkElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer) error
|
||||
}
|
||||
|
||||
if len(node.LinkData.Destination) > 0 {
|
||||
style := *tr.style[Link]
|
||||
pre := " "
|
||||
style := tr.style[Link]
|
||||
if !textRendered {
|
||||
pre = ""
|
||||
style.Prefix = ""
|
||||
@@ -46,7 +46,7 @@ func (e *LinkElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer) error
|
||||
el := &BaseElement{
|
||||
Token: resolveRelativeURL(tr.BaseURL, string(node.LinkData.Destination)),
|
||||
Prefix: pre,
|
||||
Style: &style,
|
||||
Style: style,
|
||||
}
|
||||
err := el.Render(w, node, tr)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user