🎨 Clean code

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-01-20 10:05:28 +08:00
parent f6e9ed5b55
commit d5f7bf2c02
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 5 additions and 1 deletions

View file

@ -27,6 +27,10 @@ import (
"github.com/siyuan-note/logging"
)
func ReplaceNewline(text, replaceWith string) string {
return regexp.MustCompile(`[\r\n]+`).ReplaceAllString(text, replaceWith)
}
func ContainsCJK(text string) bool {
for _, r := range text {
ret := unicode.Is(unicode.Han, r) || unicode.Is(unicode.Lm, r) ||