Cascade other style options to children when requested

This commit is contained in:
Christian Muehlhaeuser
2019-12-05 14:07:10 +01:00
parent eaed263d06
commit c4b02ad80d
13 changed files with 120 additions and 59 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ func (e *LinkElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer) error
if len(node.LastChild.Literal) > 0 {
el := &BaseElement{
Token: string(node.LastChild.Literal),
Style: LinkText,
Style: tr.style[LinkText],
}
err := el.Render(w, node.LastChild, tr)
if err != nil {
@@ -33,7 +33,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: " ",
Style: Link,
Style: tr.style[Link],
}
err := el.Render(w, node, tr)
if err != nil {