mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-23 16:56:10 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
48134df50b
6 changed files with 32 additions and 15 deletions
6
app/stage/protyle/js/lute/lute.min.js
vendored
6
app/stage/protyle/js/lute/lute.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -80,7 +80,7 @@ func changeAttrViewLayout(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
ret = renderAttrView(avID, "", "", 1, -1)
|
||||
ret = renderAttrView(blockID, avID, "", "", 1, -1)
|
||||
c.JSON(http.StatusOK, ret)
|
||||
}
|
||||
|
||||
|
|
@ -596,6 +596,11 @@ func renderAttributeView(c *gin.Context) {
|
|||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
blockIDArg := arg["blockID"]
|
||||
var blockID string
|
||||
if nil != blockIDArg {
|
||||
blockID = blockIDArg.(string)
|
||||
}
|
||||
viewIDArg := arg["viewID"]
|
||||
var viewID string
|
||||
if nil != viewIDArg {
|
||||
|
|
@ -619,13 +624,13 @@ func renderAttributeView(c *gin.Context) {
|
|||
query = queryArg.(string)
|
||||
}
|
||||
|
||||
ret = renderAttrView(id, viewID, query, page, pageSize)
|
||||
ret = renderAttrView(blockID, id, viewID, query, page, pageSize)
|
||||
c.JSON(http.StatusOK, ret)
|
||||
}
|
||||
|
||||
func renderAttrView(avID, viewID, query string, page, pageSize int) (ret *gulu.Result) {
|
||||
func renderAttrView(blockID, avID, viewID, query string, page, pageSize int) (ret *gulu.Result) {
|
||||
ret = gulu.Ret.NewResult()
|
||||
view, attrView, err := model.RenderAttributeView(avID, viewID, query, page, pageSize)
|
||||
view, attrView, err := model.RenderAttributeView(blockID, avID, viewID, query, page, pageSize)
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ func html2BlockDOM(c *gin.Context) {
|
|||
dom := arg["dom"].(string)
|
||||
luteEngine := util.NewLute()
|
||||
luteEngine.SetHTMLTag2TextMark(true)
|
||||
luteEngine.SetHTML2MarkdownAttrs([]string{"name", "alias", "memo", "bookmark", "custom-*"})
|
||||
markdown, withMath, err := model.HTML2Markdown(dom, luteEngine)
|
||||
if err != nil {
|
||||
ret.Data = "Failed to convert"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ require (
|
|||
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
|
||||
github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7
|
||||
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689
|
||||
github.com/88250/lute v1.7.7-0.20250713043055-03df5ad1ff1a
|
||||
github.com/88250/lute v1.7.7-0.20250715091146-02eb98a35a94
|
||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
|
||||
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
|
||||
github.com/ConradIrwin/font v0.2.1
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT
|
|||
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689 h1:39y5g7vnFAIcXhTN3IXPk7h2xBhC4a9hBTykDhHJqRY=
|
||||
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689/go.mod h1:c8uVw25vW2W4dhJ/j4iYsX5H1hc19spim266jO5x2hU=
|
||||
github.com/88250/lute v1.7.7-0.20250713043055-03df5ad1ff1a h1:E8TUB0xKFDTfbmxKo0ywjoQofqD3tM2GRDII6IjdKEM=
|
||||
github.com/88250/lute v1.7.7-0.20250713043055-03df5ad1ff1a/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
|
||||
github.com/88250/lute v1.7.7-0.20250715091146-02eb98a35a94 h1:yiw7qM/Xej+y5zQSAASqOELgHkbvLV3h1AdKN/kZYKU=
|
||||
github.com/88250/lute v1.7.7-0.20250715091146-02eb98a35a94/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
|
||||
github.com/88250/pdfcpu v0.3.14-0.20250424122812-f10e8d9d8d46 h1:Bq1JsDfVbHKUxNL/B2JXd8cC/1h6aFjrlXpGycnh0Hk=
|
||||
github.com/88250/pdfcpu v0.3.14-0.20250424122812-f10e8d9d8d46/go.mod h1:fVfOloBzs2+W2VJCCbq60XIxc3yJHAZ0Gahv1oO0gyI=
|
||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=
|
||||
|
|
|
|||
|
|
@ -1284,7 +1284,7 @@ func RenderRepoSnapshotAttributeView(indexID, avID string) (viewable av.Viewable
|
|||
}
|
||||
}
|
||||
|
||||
viewable, err = renderAttributeView(attrView, "", "", 1, -1)
|
||||
viewable, err = renderAttributeView(attrView, "", "", "", 1, -1)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -1327,11 +1327,11 @@ func RenderHistoryAttributeView(avID, created string) (viewable av.Viewable, att
|
|||
}
|
||||
}
|
||||
|
||||
viewable, err = renderAttributeView(attrView, "", "", 1, -1)
|
||||
viewable, err = renderAttributeView(attrView, "", "", "", 1, -1)
|
||||
return
|
||||
}
|
||||
|
||||
func RenderAttributeView(avID, viewID, query string, page, pageSize int) (viewable av.Viewable, attrView *av.AttributeView, err error) {
|
||||
func RenderAttributeView(blockID, avID, viewID, query string, page, pageSize int) (viewable av.Viewable, attrView *av.AttributeView, err error) {
|
||||
waitForSyncingStorages()
|
||||
|
||||
if avJSONPath := av.GetAttributeViewDataPath(avID); !filelock.IsExist(avJSONPath) {
|
||||
|
|
@ -1348,7 +1348,7 @@ func RenderAttributeView(avID, viewID, query string, page, pageSize int) (viewab
|
|||
return
|
||||
}
|
||||
|
||||
viewable, err = renderAttributeView(attrView, viewID, query, page, pageSize)
|
||||
viewable, err = renderAttributeView(attrView, blockID, viewID, query, page, pageSize)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -1358,7 +1358,7 @@ const (
|
|||
groupNameNext7Days, groupNameNext30Days = "_@next7Days@_", "_@next30Days@_"
|
||||
)
|
||||
|
||||
func renderAttributeView(attrView *av.AttributeView, viewID, query string, page, pageSize int) (viewable av.Viewable, err error) {
|
||||
func renderAttributeView(attrView *av.AttributeView, blockID, viewID, query string, page, pageSize int) (viewable av.Viewable, err error) {
|
||||
if 1 > len(attrView.Views) {
|
||||
view, _, _ := av.NewTableViewWithBlockKey(ast.NewNodeID())
|
||||
attrView.Views = append(attrView.Views, view)
|
||||
|
|
@ -1369,6 +1369,17 @@ func renderAttributeView(attrView *av.AttributeView, viewID, query string, page,
|
|||
}
|
||||
}
|
||||
|
||||
if "" == viewID && "" != blockID {
|
||||
if "" != blockID {
|
||||
node, _, getErr := getNodeByBlockID(nil, blockID)
|
||||
if nil != getErr {
|
||||
logging.LogWarnf("get node by block ID [%s] failed: %s", blockID, getErr)
|
||||
} else {
|
||||
viewID = node.IALAttr(av.NodeAttrView)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var view *av.View
|
||||
if "" != viewID {
|
||||
view, _ = attrView.GetCurrentView(viewID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue