Support adding the watermark on export PDF https://github.com/siyuan-note/siyuan/issues/9961

This commit is contained in:
Daniel 2023-12-27 11:43:21 +08:00
parent efac191a82
commit 2ff2f1972e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 46 additions and 31 deletions

View file

@ -18,10 +18,23 @@ package util
import (
"regexp"
"unicode"
"github.com/88250/gulu"
)
func ContainsCJK(text string) bool {
for _, r := range text {
ret := unicode.Is(unicode.Han, r) || unicode.Is(unicode.Lm, r) ||
unicode.Is(unicode.Hiragana, r) || unicode.Is(unicode.Katakana, r) ||
unicode.Is(unicode.Hangul, r)
if ret {
return true
}
}
return false
}
var emojiRegex = regexp.MustCompile(`/([0-9#][\x{20E3}])|` +
`[\x{00ae}\x{00a9}\x{203C}\x{2047}\x{2048}\x{2049}\x{3030}\x{303D}\x{2139}\x{2122}\x{3297}\x{3299}]|` +
`[\x{2190}-\x{21FF}]|[\x{FE00}-\x{FEFF}]|` +