Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultEmojis def.Emojis
Functions ¶
func NewEmojiHTMLRenderer ¶
func NewEmojiHTMLRenderer() renderer.NodeRenderer
func NewEmojiParser ¶
func NewEmojiParser(emojis def.Emojis) parser.InlineParser
func NewExtender ¶
Example ¶
package main import ( "bytes" "fmt" emoji "github.com/CarsonSlovoka/goldmark-emoji/v2" "github.com/CarsonSlovoka/goldmark-emoji/v2/def" "github.com/yuin/goldmark" "os" ) func main() { markdown := goldmark.New( goldmark.WithExtensions( emoji.NewExtender(def.Github(), def.TW()), ), ) if err := markdown.Convert([]byte(":blush:"), os.Stdout); err != nil { panic(err) } out := bytes.NewBuffer(make([]byte, 0)) content := []byte(`Hello World. :blush: :臉紅:`) if err := markdown.Convert(content, out); err != nil { panic(err) } fmt.Println(out) }
Output: <p>😊</p> <p>Hello World. 😊 😊</p>
Types ¶
type ParserConfig ¶
Click to show internal directories.
Click to hide internal directories.