Inherit prefix and suffix from parent style on demand

This commit is contained in:
Christian Muehlhaeuser
2019-12-06 00:24:31 +01:00
parent b62a54035e
commit 239b3ec93c
+8
View File
@@ -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
}