mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-08-31 14:16:44 -04:00
Remove blackfriday requirement from clients
This commit is contained in:
@@ -209,6 +209,18 @@ func NewElement(node *bf.Node) Element {
|
||||
|
||||
}
|
||||
|
||||
func Render(in string, stylePath string) ([]byte, error) {
|
||||
return RenderBytes([]byte(in), stylePath)
|
||||
}
|
||||
|
||||
func RenderBytes(in []byte, stylePath string) ([]byte, error) {
|
||||
r, err := NewTermRenderer(stylePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return bf.Run(in, bf.WithRenderer(r)), nil
|
||||
}
|
||||
|
||||
func NewTermRenderer(stylePath string) (*TermRenderer, error) {
|
||||
if stylePath == "" {
|
||||
return NewTermRendererFromBytes([]byte("{}"))
|
||||
|
||||
Reference in New Issue
Block a user