mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
🎨 集市支持已安装的包单独显示 https://github.com/siyuan-note/siyuan/issues/5678
This commit is contained in:
parent
3ad5bb7607
commit
cde994cbd4
5 changed files with 12 additions and 10 deletions
|
|
@ -244,16 +244,21 @@ func GetPackageREADME(repoURL, repoHash string, systemID string) (ret string) {
|
|||
}
|
||||
}
|
||||
|
||||
ret, err = renderREADME(repoURL, data)
|
||||
return
|
||||
}
|
||||
|
||||
func renderREADME(repoURL string, mdData []byte) (ret string, err error) {
|
||||
luteEngine := lute.New()
|
||||
luteEngine.SetSoftBreak2HardBreak(false)
|
||||
luteEngine.SetCodeSyntaxHighlight(false)
|
||||
linkBase := repoURL + "/blob/main/"
|
||||
luteEngine.SetLinkBase(linkBase)
|
||||
ret = luteEngine.Md2HTML(string(data))
|
||||
ret = luteEngine.Md2HTML(string(mdData))
|
||||
doc, err := goquery.NewDocumentFromReader(strings.NewReader(ret))
|
||||
if nil != err {
|
||||
logging.LogErrorf("parse HTML failed: %s", err)
|
||||
return ret
|
||||
return
|
||||
}
|
||||
|
||||
doc.Find("a").Each(func(i int, selection *goquery.Selection) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue