Skip to content

Commit 6203b5b

Browse files
sy-recordsLinkinStars
authored andcommitted
fix: use TrimSpace
1 parent b31d644 commit 6203b5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/converter/markdown.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ package converter
2222
import (
2323
"bytes"
2424
"regexp"
25+
"strings"
2526

2627
"github.com/asaskevich/govalidator"
2728
"github.com/microcosm-cc/bluemonday"
@@ -61,7 +62,7 @@ func Markdown2HTML(source string) string {
6162
filter.AllowElements("kbd")
6263
filter.AllowAttrs("title").Matching(regexp.MustCompile(`^[\p{L}\p{N}\s\-_',\[\]!\./\\\(\)]*$|^@embed?$`)).Globally()
6364
filter.AllowAttrs("start").OnElements("ol")
64-
html = filter.Sanitize(html)
65+
html = strings.TrimSpace(filter.Sanitize(html))
6566
return html
6667
}
6768

0 commit comments

Comments
 (0)