Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-04-03 18:31:15 +08:00
commit f5f24e06cb
3 changed files with 10 additions and 16 deletions

View File

@ -6,7 +6,7 @@ require (
github.com/88250/clipboard v0.1.5 github.com/88250/clipboard v0.1.5
github.com/88250/css v0.1.2 github.com/88250/css v0.1.2
github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37 github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37
github.com/88250/lute v1.7.6-0.20230401063148-62a951533845 github.com/88250/lute v1.7.6-0.20230403100042-3f9a3d1d19cd
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20230220142845-f237b6348b3e github.com/ClarkThan/ahocorasick v0.0.0-20230220142845-f237b6348b3e
@ -14,8 +14,6 @@ require (
github.com/Masterminds/sprig/v3 v3.2.3 github.com/Masterminds/sprig/v3 v3.2.3
github.com/PuerkitoBio/goquery v1.8.1 github.com/PuerkitoBio/goquery v1.8.1
github.com/Xuanwo/go-locale v1.1.0 github.com/Xuanwo/go-locale v1.1.0
github.com/adrg/strutil v0.2.2
github.com/adrg/sysfont v0.1.2
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be
github.com/denisbrodbeck/machineid v1.0.1 github.com/denisbrodbeck/machineid v1.0.1
@ -67,7 +65,6 @@ require (
dmitri.shuralyov.com/font/woff2 v0.0.0-20180220214647-957792cbbdab // indirect dmitri.shuralyov.com/font/woff2 v0.0.0-20180220214647-957792cbbdab // indirect
github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/adrg/xdg v0.3.0 // indirect
github.com/alecthomas/chroma v0.10.0 // indirect github.com/alecthomas/chroma v0.10.0 // indirect
github.com/andybalholm/cascadia v1.3.1 // indirect github.com/andybalholm/cascadia v1.3.1 // indirect
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef // indirect github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef // indirect

View File

@ -8,8 +8,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXS
github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37 h1:7ZMvlXDbH2sqaxowoAFcLjcdRN7ncVE0U1S2ukpUgac= github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37 h1:7ZMvlXDbH2sqaxowoAFcLjcdRN7ncVE0U1S2ukpUgac=
github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37/go.mod h1:pTWnjt+6qUqNnP9xltswsJxgCBVu3C7eW09u48LWX0k= github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37/go.mod h1:pTWnjt+6qUqNnP9xltswsJxgCBVu3C7eW09u48LWX0k=
github.com/88250/lute v1.7.6-0.20230401063148-62a951533845 h1:MD5+Mcbj/mqY7fAEGPpzm8kJXAJCXOr4gJMKjP0XegE= github.com/88250/lute v1.7.6-0.20230403100042-3f9a3d1d19cd h1:qkrS7DWmWelI1+8uHL3QK9Mtle8Vuqzui3iK7bF+pME=
github.com/88250/lute v1.7.6-0.20230401063148-62a951533845/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg= github.com/88250/lute v1.7.6-0.20230403100042-3f9a3d1d19cd/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0= github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4= github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY= github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=
@ -29,12 +29,6 @@ github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAc
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
github.com/Xuanwo/go-locale v1.1.0 h1:51gUxhxl66oXAjI9uPGb2O0qwPECpriKQb2hl35mQkg= github.com/Xuanwo/go-locale v1.1.0 h1:51gUxhxl66oXAjI9uPGb2O0qwPECpriKQb2hl35mQkg=
github.com/Xuanwo/go-locale v1.1.0/go.mod h1:UKrHoZB3FPIk9wIG2/tVSobnHgNnceGSH3Y8DY5cASs= github.com/Xuanwo/go-locale v1.1.0/go.mod h1:UKrHoZB3FPIk9wIG2/tVSobnHgNnceGSH3Y8DY5cASs=
github.com/adrg/strutil v0.2.2 h1:XSd9+o2xaOon2oRum0JymNT+f0nfLiAiDzGOcjcIsMI=
github.com/adrg/strutil v0.2.2/go.mod h1:EF2fjOFlGTepljfI+FzgTG13oXthR7ZAil9/aginnNQ=
github.com/adrg/sysfont v0.1.2 h1:MSU3KREM4RhsQ+7QgH7wPEPTgAgBIz0Hw6Nd4u7QgjE=
github.com/adrg/sysfont v0.1.2/go.mod h1:6d3l7/BSjX9VaeXWJt9fcrftFaD/t7l11xgSywCPZGk=
github.com/adrg/xdg v0.3.0 h1:BO+k4wFj0IoTolBF1Apn8oZrX3LQrEbBA8+/9vyW9J4=
github.com/adrg/xdg v0.3.0/go.mod h1:7I2hH/IT30IsupOpKZ5ue7/qNi3CoKzD6tL3HwpaRMQ=
github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek= github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s= github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=

View File

@ -552,7 +552,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
logging.LogErrorf("parse tree [%s] failed", currentPath) logging.LogErrorf("parse tree [%s] failed", currentPath)
return nil return nil
} }
imgHtmlBlock2InlineImg(tree)
tree.ID = id tree.ID = id
tree.Root.ID = id tree.Root.ID = id
tree.Root.SetIALAttr("id", tree.Root.ID) tree.Root.SetIALAttr("id", tree.Root.ID)
@ -563,7 +563,6 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
targetPaths[curRelPath] = targetPath targetPaths[curRelPath] = targetPath
tree.HPath = hPath tree.HPath = hPath
tree.Root.Spec = "1" tree.Root.Spec = "1"
parse.NestedInlines2FlattedSpans(tree)
docDirLocalPath := filepath.Dir(filepath.Join(boxLocalPath, targetPath)) docDirLocalPath := filepath.Dir(filepath.Join(boxLocalPath, targetPath))
assetDirPath := getAssetsDir(boxLocalPath, docDirLocalPath) assetDirPath := getAssetsDir(boxLocalPath, docDirLocalPath)
@ -647,7 +646,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
logging.LogErrorf(msg) logging.LogErrorf(msg)
return errors.New(msg) return errors.New(msg)
} }
imgHtmlBlock2InlineImg(tree)
tree.ID = id tree.ID = id
tree.Root.ID = id tree.Root.ID = id
tree.Root.SetIALAttr("id", tree.Root.ID) tree.Root.SetIALAttr("id", tree.Root.ID)
@ -656,7 +655,6 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
tree.Path = targetPath tree.Path = targetPath
tree.HPath = path.Join(baseHPath, title) tree.HPath = path.Join(baseHPath, title)
tree.Root.Spec = "1" tree.Root.Spec = "1"
parse.NestedInlines2FlattedSpans(tree)
docDirLocalPath := filepath.Dir(filepath.Join(boxLocalPath, targetPath)) docDirLocalPath := filepath.Dir(filepath.Join(boxLocalPath, targetPath))
assetDirPath := getAssetsDir(boxLocalPath, docDirLocalPath) assetDirPath := getAssetsDir(boxLocalPath, docDirLocalPath)
@ -724,7 +722,12 @@ func parseStdMd(markdown []byte) (ret *parse.Tree) {
luteEngine.SetGFMAutoLink(false) // 导入 Markdown 时不自动转换超链接 https://github.com/siyuan-note/siyuan/issues/7682 luteEngine.SetGFMAutoLink(false) // 导入 Markdown 时不自动转换超链接 https://github.com/siyuan-note/siyuan/issues/7682
luteEngine.SetImgPathAllowSpace(true) luteEngine.SetImgPathAllowSpace(true)
ret = parse.Parse("", markdown, luteEngine.ParseOptions) ret = parse.Parse("", markdown, luteEngine.ParseOptions)
if nil == ret {
return
}
genTreeID(ret) genTreeID(ret)
imgHtmlBlock2InlineImg(ret)
parse.NestedInlines2FlattedSpansHybrid(ret)
return return
} }