{"record":{"id":"d42720309c45704d","repo":"siyuan-note/siyuan","slug":"only-supports-importing-markdown-document","errorCode":null,"errorMessage":"Only supports importing Markdown document","messagePattern":"Only supports importing Markdown document","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/import.go","lineNumber":1513,"sourceCode":"\t\t\t\treturn ast.WalkContinue\n\t\t\t})\n\n\t\t\treassignIDUpdated(tree, id, updated)\n\t\t\timportTrees = append(importTrees, tree)\n\n\t\t\thPathsIDs[tree.HPath] = tree.ID\n\t\t\tidPaths[tree.ID] = tree.Path\n\n\t\t\tcount++\n\t\t\tif 0 == count%4 {\n\t\t\t\tutil.PushEndlessProgress(fmt.Sprintf(Conf.language(70), fmt.Sprintf(\"%s\", tree.HPath)))\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t} else { // 导入单个文件\n\t\tfileName := filepath.Base(localPath)\n\t\tif !strings.HasSuffix(fileName, \".md\") && !strings.HasSuffix(fileName, \".markdown\") {\n\t\t\treturn errors.New(Conf.Language(79))\n\t\t}\n\n\t\ttitle := strings.TrimSuffix(fileName, \".markdown\")\n\t\ttitle = strings.TrimSuffix(title, \".md\")\n\t\ttargetPath := strings.TrimSuffix(toPath, \".sy\")\n\t\tid := ast.NewNodeID()\n\t\ttargetPath = path.Join(targetPath, id+\".sy\")\n\t\tvar data []byte\n\t\tdata, err = os.ReadFile(localPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttree, yfmRootID, yfmTitle, yfmUpdated := parseStdMd(data)\n\t\tif nil == tree {\n\t\t\tmsg := fmt.Sprintf(\"parse tree [%s] failed\", localPath)\n\t\t\tlogging.LogError(msg)\n\t\t\treturn errors.New(msg)\n\t\t}","sourceCodeStart":1495,"sourceCodeEnd":1531,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/afa823b6b4e4f183511e0bc0a3be93caa94c7c97/kernel/model/import.go#L1495-L1531","documentation":"Error \"Only supports importing Markdown document\" thrown in siyuan-note/siyuan.","triggerScenarios":"Thrown at kernel/model/import.go:1513 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Select a file with the .md or .markdown extension","Convert the file to Markdown format first, then import it"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afa823b6b4e4f183511e0bc0a3be93caa94c7c97","analyzedAt":"2026-08-18T17:04:10.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}