mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 08:57:14 -04:00
Support format strings in style elements
This commit is contained in:
@@ -67,6 +67,7 @@ type ElementStyle struct {
|
||||
Theme string `json:"theme"`
|
||||
Prefix string `json:"prefix"`
|
||||
Suffix string `json:"suffix"`
|
||||
Format string `json:"format"`
|
||||
}
|
||||
|
||||
func loadStyle(f string) ([]byte, error) {
|
||||
@@ -119,6 +120,7 @@ func cascadeStyle(parent ElementStyle, child ElementStyle, onlyColors bool) Elem
|
||||
s.Blink = parent.Blink
|
||||
s.Prefix = parent.Prefix
|
||||
s.Suffix = parent.Suffix
|
||||
s.Format = parent.Format
|
||||
}
|
||||
|
||||
if child.Color != nil {
|
||||
@@ -166,6 +168,9 @@ func cascadeStyle(parent ElementStyle, child ElementStyle, onlyColors bool) Elem
|
||||
if child.Suffix != "" {
|
||||
s.Suffix = child.Suffix
|
||||
}
|
||||
if child.Format != "" {
|
||||
s.Format = child.Format
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user