Strip carriage returns in markdown rendering (#1351)
This commit is contained in:
parent
659a474a13
commit
1ddb4d76a7
1 changed files with 3 additions and 0 deletions
|
|
@ -26,6 +26,9 @@ func RenderMarkdown(text string) (string, error) {
|
|||
if isColorEnabled() {
|
||||
style = "dark"
|
||||
}
|
||||
// Glamour rendering preserves carriage return characters in code blocks, but
|
||||
// we need to ensure that no such characters are present in the output.
|
||||
text = strings.ReplaceAll(text, "\r\n", "\n")
|
||||
return glamour.Render(text, style)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue