Improved performance

This commit is contained in:
2024-04-02 11:50:37 +02:00
parent 09245c5e92
commit 68111da0a2
2 changed files with 5 additions and 4 deletions

View File

@ -3,6 +3,7 @@ package markdown
import (
"html"
"strings"
"unsafe"
)
var (
@ -40,7 +41,7 @@ func Render(markdown string) string {
r.WriteString("</blockquote>")
}
return string(r.out)
return unsafe.String(unsafe.SliceData(r.out), len(r.out))
}
if i != len(markdown) && markdown[i] != '\n' {