mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 00:47:15 -04:00
Add support for :emoji: (#92)
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
east "github.com/yuin/goldmark-emoji/ast"
|
||||
"github.com/yuin/goldmark/ast"
|
||||
astext "github.com/yuin/goldmark/extension/ast"
|
||||
)
|
||||
@@ -375,6 +376,14 @@ func (tr *ANSIRenderer) NewElement(node ast.Node, source []byte) Element {
|
||||
case ast.KindTextBlock:
|
||||
return Element{}
|
||||
|
||||
case east.KindEmoji:
|
||||
n := node.(*east.Emoji)
|
||||
return Element{
|
||||
Renderer: &BaseElement{
|
||||
Token: string(n.Value.Unicode),
|
||||
},
|
||||
}
|
||||
|
||||
// Unknown case
|
||||
default:
|
||||
fmt.Println("Warning: unhandled element", node.Kind().String())
|
||||
|
||||
Reference in New Issue
Block a user