siyuan-note/siyuan · error
Only supports importing Markdown document
Error message
Only supports importing Markdown document
What it means
Error "Only supports importing Markdown document" thrown in siyuan-note/siyuan.
Solutions
- Select a file with the .md or .markdown extension
- Convert the file to Markdown format first, then import it
When it happens
Trigger: Thrown at kernel/model/import.go:1513 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of siyuan-note/siyuan@afa823b6b4 (2026-08-18).
Data as JSON: /api/errors/d42720309c45704d.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/import.go:1513
return ast.WalkContinue
})
reassignIDUpdated(tree, id, updated)
importTrees = append(importTrees, tree)
hPathsIDs[tree.HPath] = tree.ID
idPaths[tree.ID] = tree.Path
count++
if 0 == count%4 {
util.PushEndlessProgress(fmt.Sprintf(Conf.language(70), fmt.Sprintf("%s", tree.HPath)))
}
return nil
})
} else { // 导入单个文件
fileName := filepath.Base(localPath)
if !strings.HasSuffix(fileName, ".md") && !strings.HasSuffix(fileName, ".markdown") {
return errors.New(Conf.Language(79))
}
title := strings.TrimSuffix(fileName, ".markdown")
title = strings.TrimSuffix(title, ".md")
targetPath := strings.TrimSuffix(toPath, ".sy")
id := ast.NewNodeID()
targetPath = path.Join(targetPath, id+".sy")
var data []byte
data, err = os.ReadFile(localPath)
if err != nil {
return err
}
tree, yfmRootID, yfmTitle, yfmUpdated := parseStdMd(data)
if nil == tree {
msg := fmt.Sprintf("parse tree [%s] failed", localPath)
logging.LogError(msg)
return errors.New(msg)
}View on GitHub (pinned to afa823b6b4)