mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-02 02:40:15 +01:00
🎨 导入 Markdown 时不自动转换超链接 Fix https://github.com/siyuan-note/siyuan/issues/7682
This commit is contained in:
parent
cb85bb8080
commit
7ddf99dab8
2 changed files with 18 additions and 17 deletions
|
|
@ -38,6 +38,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute"
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/88250/lute/html"
|
||||
"github.com/88250/lute/html/atom"
|
||||
|
|
@ -705,6 +706,23 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func parseStdMd(markdown []byte) (ret *parse.Tree) {
|
||||
luteEngine := lute.New()
|
||||
luteEngine.SetFootnotes(false)
|
||||
luteEngine.SetToC(false)
|
||||
luteEngine.SetIndentCodeBlock(false)
|
||||
luteEngine.SetAutoSpace(false)
|
||||
luteEngine.SetHeadingID(false)
|
||||
luteEngine.SetSetext(false)
|
||||
luteEngine.SetYamlFrontMatter(false)
|
||||
luteEngine.SetLinkRef(false)
|
||||
luteEngine.SetGFMAutoLink(false) // 导入 Markdown 时不自动转换超链接 https://github.com/siyuan-note/siyuan/issues/7682
|
||||
luteEngine.SetImgPathAllowSpace(true)
|
||||
ret = parse.Parse("", markdown, luteEngine.ParseOptions)
|
||||
genTreeID(ret)
|
||||
return
|
||||
}
|
||||
|
||||
func processBase64Img(n *ast.Node, dest string, assetDirPath string, err error) {
|
||||
base64TmpDir := filepath.Join(util.TempDir, "base64")
|
||||
os.MkdirAll(base64TmpDir, 0755)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue