🎨 Clean code

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-01-20 10:39:23 +08:00
parent e9564ff0ec
commit ffd947233e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -27,8 +27,10 @@ import (
"github.com/siyuan-note/logging"
)
var newlinesRegex = regexp.MustCompile(`[\r\n]+`)
func ReplaceNewline(text, replaceWith string) string {
return regexp.MustCompile(`[\r\n]+`).ReplaceAllString(text, replaceWith)
return newlinesRegex.ReplaceAllString(text, replaceWith)
}
func ContainsCJK(text string) bool {