From 239b3ec93ced73782838403d3b26bdb07bf8b4ac Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 6 Dec 2019 00:24:31 +0100 Subject: [PATCH] Inherit prefix and suffix from parent style on demand --- style.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/style.go b/style.go index 45d12ee..e634c46 100644 --- a/style.go +++ b/style.go @@ -90,6 +90,8 @@ func cascadeStyle(parent ElementStyle, child ElementStyle, onlyColors bool) Elem s.Overlined = parent.Overlined s.Inverse = parent.Inverse s.Blink = parent.Blink + s.Prefix = parent.Prefix + s.Suffix = parent.Suffix } if child.Color != nil { @@ -131,6 +133,12 @@ func cascadeStyle(parent ElementStyle, child ElementStyle, onlyColors bool) Elem if child.Blink != nil { s.Blink = child.Blink } + if child.Prefix != "" { + s.Prefix = child.Prefix + } + if child.Suffix != "" { + s.Suffix = child.Suffix + } return s }