mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Improve escaping https://github.com/siyuan-note/siyuan/issues/13135
This commit is contained in:
parent
7b342fc004
commit
a2a46f8f39
3 changed files with 4 additions and 22 deletions
|
@ -23,16 +23,13 @@ import (
|
|||
"unicode/utf8"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
|
||||
"github.com/88250/lute/lex"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func MarkText(text string, keyword string, beforeLen int, caseSensitive bool) (pos int, marked string) {
|
||||
if "" == keyword {
|
||||
return -1, util.EscapeHTML(text)
|
||||
return -1, text
|
||||
}
|
||||
text = util.EscapeHTML(text)
|
||||
keywords := SplitKeyword(keyword)
|
||||
marked = EncloseHighlighting(text, keywords, "<mark>", "</mark>", caseSensitive, false)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue