mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-10-27 03:29:58 -04:00
Render prefix/suffix in current style
This commit is contained in:
1 parent
e43288b69c
commit
011c602e64
1 file changed
+2
-2
+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