mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-08-30 05:36:42 -04:00
Let users define a prefix & suffix for style elements
This commit is contained in:
@@ -31,6 +31,14 @@ func (e *BaseElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer) error
|
||||
fmt.Fprintf(w, "%s", e.Token)
|
||||
return nil
|
||||
}
|
||||
if rules.Prefix != "" {
|
||||
fmt.Fprintf(w, "%s", rules.Prefix)
|
||||
}
|
||||
defer func() {
|
||||
if rules.Suffix != "" {
|
||||
fmt.Fprintf(w, "%s", rules.Suffix)
|
||||
}
|
||||
}()
|
||||
|
||||
out := aurora.Reset(e.Token)
|
||||
if rules.Color != "" {
|
||||
|
||||
Reference in New Issue
Block a user