Skip to content

Commit 91c4530

Browse files
committed
Trim *all* trailing (and leading) newlines from code blocks
1 parent bb6c7e4 commit 91c4530

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

markdown/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (_ *markdownRenderer) BlockCode(out *bytes.Buffer, text []byte, lang string
6767
text = formattedCode
6868
}
6969

70-
text = []byte(strings.TrimSuffix(string(text), "\n"))
70+
text = []byte(strings.Trim(string(text), "\n"))
7171
if count == 0 {
7272
text = []byte("\t" + strings.Replace(string(text), "\n", "\n\t", -1))
7373
}

0 commit comments

Comments
 (0)