mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-02 06:57:30 -04:00
Decouple render elements from blackfriday parser
This commit is contained in:
+2
-3
@@ -11,7 +11,6 @@ import (
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/lucasb-eyer/go-colorful"
|
||||
bf "gopkg.in/russross/blackfriday.v2"
|
||||
)
|
||||
|
||||
type BaseElement struct {
|
||||
@@ -137,8 +136,8 @@ func renderText(w io.Writer, rules ElementStyle, s string) {
|
||||
_, _ = w.Write([]byte(out.String()))
|
||||
}
|
||||
|
||||
func (e *BaseElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer) error {
|
||||
bs := tr.context.blockStack
|
||||
func (e *BaseElement) Render(w io.Writer, ctx RenderContext) error {
|
||||
bs := ctx.blockStack
|
||||
|
||||
renderText(w, bs.Current().Style, e.Prefix)
|
||||
defer func() {
|
||||
|
||||
Reference in New Issue
Block a user