🎨 Improve images render in the marketplace package https://github.com/siyuan-note/bazaar/issues/1119

This commit is contained in:
Liang Ding 2023-05-14 23:21:32 +08:00
parent 7572db4012
commit 2cf8a8191a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -497,7 +497,7 @@ func renderREADME(repoURL string, mdData []byte) (ret string, err error) {
luteEngine := lute.New()
luteEngine.SetSoftBreak2HardBreak(false)
luteEngine.SetCodeSyntaxHighlight(false)
linkBase := repoURL + "/blob/main/"
linkBase := "https://cdn.jsdelivr.net/gh/" + strings.TrimPrefix(repoURL, "https://github.com/")
luteEngine.SetLinkBase(linkBase)
ret = luteEngine.Md2HTML(string(mdData))
doc, err := goquery.NewDocumentFromReader(strings.NewReader(ret))