mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-10-27 03:29:58 -04:00
Remove blackfriday requirement from clients
This commit is contained in:
1 parent
8300cb7a55
commit
8f16561ac5
1 file changed
+12
@@ -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