Preserve newlines in GitHub-flavored markdown
This commit is contained in:
parent
456d55ead9
commit
4e1bca736f
3 changed files with 16 additions and 34 deletions
|
|
@ -52,7 +52,7 @@ func Render(text string, opts ...glamour.TermRendererOption) (string, error) {
|
|||
// we need to ensure that no such characters are present in the output.
|
||||
text = strings.ReplaceAll(text, "\r\n", "\n")
|
||||
|
||||
opts = append(opts, glamour.WithEmoji())
|
||||
opts = append(opts, glamour.WithEmoji(), glamour.WithPreservedNewLines())
|
||||
tr, err := glamour.NewTermRenderer(opts...)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue