Enable emoji in markdown
This commit is contained in:
parent
21c4f1498e
commit
dafa2f61c9
1 changed files with 4 additions and 0 deletions
|
|
@ -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),
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue