Enable emoji in markdown

This commit is contained in:
Sam Coe 2021-04-12 09:50:42 -07:00
parent 21c4f1498e
commit dafa2f61c9
No known key found for this signature in database
GPG key ID: 8E322C20F811D086

View file

@ -43,6 +43,7 @@ func render(text string, opts RenderOpts) (string, error) {
func Render(text, style string) (string, error) {
opts := RenderOpts{
glamour.WithStylePath(style),
glamour.WithEmoji(),
}
return render(text, opts)
@ -51,6 +52,7 @@ func Render(text, style string) (string, error) {
func RenderWithOpts(text, style string, opts RenderOpts) (string, error) {
defaultOpts := RenderOpts{
glamour.WithStylePath(style),
glamour.WithEmoji(),
}
opts = append(defaultOpts, opts...)
@ -60,6 +62,7 @@ func RenderWithOpts(text, style string, opts RenderOpts) (string, error) {
func RenderWithBaseURL(text, style, baseURL string) (string, error) {
opts := RenderOpts{
glamour.WithStylePath(style),
glamour.WithEmoji(),
glamour.WithBaseURL(baseURL),
}
@ -69,6 +72,7 @@ func RenderWithBaseURL(text, style, baseURL string) (string, error) {
func RenderWithWrap(text, style string, wrap int) (string, error) {
opts := RenderOpts{
glamour.WithStylePath(style),
glamour.WithEmoji(),
glamour.WithWordWrap(wrap),
}