mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +01:00
🎨 Add a Ref export mode Anchor hash for notebook Markdown exporting https://github.com/siyuan-note/siyuan/issues/10265
This commit is contained in:
parent
0dd90ecef6
commit
9ffa5b7e82
8 changed files with 22 additions and 10 deletions
|
|
@ -1338,7 +1338,7 @@ func ExportPandocConvertZip(id, pandocTo, ext string) (name, zipPath string) {
|
|||
docPaths = append(docPaths, docFile.path)
|
||||
}
|
||||
|
||||
zipPath = exportPandocConvertZip(false, boxID, baseFolderName, docPaths, Conf.Export.BlockRefMode, "gfm+footnotes+hard_line_breaks", pandocTo, ext)
|
||||
zipPath = exportPandocConvertZip(false, boxID, baseFolderName, docPaths, "gfm+footnotes+hard_line_breaks", pandocTo, ext)
|
||||
name = strings.TrimSuffix(filepath.Base(block.Path), ".sy")
|
||||
return
|
||||
}
|
||||
|
|
@ -1366,7 +1366,7 @@ func BatchExportMarkdown(boxID, folderPath string) (zipPath string) {
|
|||
for _, docFile := range docFiles {
|
||||
docPaths = append(docPaths, docFile.path)
|
||||
}
|
||||
zipPath = exportPandocConvertZip(true, boxID, baseFolderName, docPaths, Conf.Export.BlockRefMode, "", "", ".md")
|
||||
zipPath = exportPandocConvertZip(true, boxID, baseFolderName, docPaths, "", "", ".md")
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -2583,7 +2583,7 @@ func processFileAnnotationRef(refID string, n *ast.Node, fileAnnotationRefMode i
|
|||
return ast.WalkSkipChildren
|
||||
}
|
||||
|
||||
func exportPandocConvertZip(exportNotebook bool, boxID, baseFolderName string, docPaths []string, exportRefMode int,
|
||||
func exportPandocConvertZip(exportNotebook bool, boxID, baseFolderName string, docPaths []string,
|
||||
pandocFrom, pandocTo, ext string) (zipPath string) {
|
||||
dir, name := path.Split(baseFolderName)
|
||||
name = util.FilterFileName(name)
|
||||
|
|
@ -2602,6 +2602,12 @@ func exportPandocConvertZip(exportNotebook bool, boxID, baseFolderName string, d
|
|||
return
|
||||
}
|
||||
|
||||
exportRefMode := Conf.Export.BlockRefMode
|
||||
if !exportNotebook && 5 == exportRefMode {
|
||||
// 非笔记本导出不支持锚点哈希,将其切换为锚文本块链
|
||||
exportRefMode = 2
|
||||
}
|
||||
|
||||
var defBlockIDs []string
|
||||
if exportNotebook && 5 == exportRefMode {
|
||||
// Add a Ref export mode `Anchor hash` for notebook Markdown exporting https://github.com/siyuan-note/siyuan/issues/10265
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue