mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 搜索结果高亮支持大部分行级元素 https://github.com/siyuan-note/siyuan/issues/6745
This commit is contained in:
parent
92b88154fb
commit
7c40b44a15
9 changed files with 35 additions and 17 deletions
|
|
@ -269,6 +269,10 @@ func getRefIDs(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
if nil == arg["id"] {
|
||||
arg["id"] = ""
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
refIDs, refTexts, defIDs := model.GetBlockRefIDs(id)
|
||||
ret.Data = map[string][]string{
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/html"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
|
|
@ -182,7 +181,7 @@ func searchRefBlock(c *gin.Context) {
|
|||
ret.Data = map[string]interface{}{
|
||||
"blocks": blocks,
|
||||
"newDoc": newDoc,
|
||||
"k": html.EscapeHTMLStr(keyword),
|
||||
"k": util.EscapeHTML(keyword),
|
||||
"reqId": arg["reqId"],
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/html"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
|
|
@ -40,7 +39,7 @@ func docSaveAsTemplate(c *gin.Context) {
|
|||
code, err := model.DocSaveAsTemplate(id, overwrite)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = html.EscapeString(err.Error())
|
||||
ret.Msg = util.EscapeHTML(err.Error())
|
||||
return
|
||||
}
|
||||
ret.Code = code
|
||||
|
|
@ -60,7 +59,7 @@ func renderTemplate(c *gin.Context) {
|
|||
content, err := model.RenderTemplate(p, id)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = html.EscapeString(err.Error())
|
||||
ret.Msg = util.EscapeHTML(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue