mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-05 08:27:18 -04:00
Render styled prefix & suffix for primitives
This commit is contained in:
@@ -145,11 +145,18 @@ func (e *BaseElement) Render(w io.Writer, ctx RenderContext) error {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
rules := bs.With(e.Style)
|
rules := bs.With(e.Style)
|
||||||
|
// render unstyled prefix/suffix
|
||||||
renderText(w, bs.Current().Style.StylePrimitive, rules.Prefix)
|
renderText(w, bs.Current().Style.StylePrimitive, rules.Prefix)
|
||||||
defer func() {
|
defer func() {
|
||||||
renderText(w, bs.Current().Style.StylePrimitive, rules.Suffix)
|
renderText(w, bs.Current().Style.StylePrimitive, rules.Suffix)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
// render styled prefix/suffix
|
||||||
|
renderText(w, rules, rules.StyledPrefix)
|
||||||
|
defer func() {
|
||||||
|
renderText(w, rules, rules.StyledSuffix)
|
||||||
|
}()
|
||||||
|
|
||||||
s := e.Token
|
s := e.Token
|
||||||
if len(rules.Format) > 0 {
|
if len(rules.Format) > 0 {
|
||||||
var err error
|
var err error
|
||||||
|
|||||||
Reference in New Issue
Block a user