mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 08:57:14 -04:00
Render prefix/suffix in current style
This commit is contained in:
+2
-2
@@ -60,11 +60,11 @@ func renderText(w io.Writer, rules *ElementStyle, s string) {
|
|||||||
|
|
||||||
func (e *BaseElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer) error {
|
func (e *BaseElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer) error {
|
||||||
if e.Prefix != "" {
|
if e.Prefix != "" {
|
||||||
_, _ = w.Write([]byte(e.Prefix))
|
renderText(w, tr.blockStyle.Current(), e.Prefix)
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
if e.Suffix != "" {
|
if e.Suffix != "" {
|
||||||
_, _ = w.Write([]byte(e.Suffix))
|
renderText(w, tr.blockStyle.Current(), e.Suffix)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user