This commit is contained in:
Daniel 2024-05-21 16:25:53 +08:00
parent aa817d17ef
commit 50090db09d
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 6 additions and 5 deletions

View file

@ -123,7 +123,7 @@ func extensionCopy(c *gin.Context) {
md, withMath, _ := model.HTML2Markdown(dom)
md = strings.TrimSpace(md)
luteEngine := util.NewStdLute()
luteEngine := util.NewLute()
if withMath {
luteEngine.SetInlineMath(true)
}
@ -153,6 +153,8 @@ func extensionCopy(c *gin.Context) {
unlink.Unlink()
}
parse.NestedInlines2FlattedSpans(tree, false)
md, _ = lute.FormatNodeSync(tree.Root, luteEngine.ParseOptions, luteEngine.RenderOptions)
ret.Data = map[string]interface{}{
"md": md,

View file

@ -8,7 +8,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.20240505150113-bc43bd50f866
github.com/88250/lute v1.7.7-0.20240520140444-22dd5810b592
github.com/88250/lute v1.7.7-0.20240521082334-e9cac81ed1b3
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
@ -172,7 +172,8 @@ require (
replace github.com/mattn/go-sqlite3 => github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950
//replace github.com/88250/lute => F:\golang\gopath\src\github.com\88250\lute
replace github.com/88250/lute => F:\golang\gopath\src\github.com\88250\lute
//replace github.com/siyuan-note/dejavu => D:\88250\dejavu
//replace github.com/siyuan-note/riff => D:\88250\riff
//replace github.com/siyuan-note/httpclient => D:\88250\httpclient

View file

@ -12,8 +12,6 @@ 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.20240505150113-bc43bd50f866 h1:RFfNFS0hv6TbOuwET6xZAfGlV4hNlXiWTnfbLN1eF6k=
github.com/88250/gulu v1.2.3-0.20240505150113-bc43bd50f866/go.mod h1:MUfzyfmbPrRDZLqxc7aPrVYveatTHRfoUa5TynPS0i8=
github.com/88250/lute v1.7.7-0.20240520140444-22dd5810b592 h1:ICYi44ga/+kHbOGy8JpPBnhUE5DFary8K4+b0GbduVw=
github.com/88250/lute v1.7.7-0.20240520140444-22dd5810b592/go.mod h1:VDAzL8b+oCh+e3NAlmwwLzC53ten0rZlS8NboB7ljtk=
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/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=