mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
✨ Support adding the watermark on export PDF https://github.com/siyuan-note/siyuan/issues/9961
This commit is contained in:
parent
efac191a82
commit
2ff2f1972e
3 changed files with 46 additions and 31 deletions
|
|
@ -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}]|` +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue