{"record":{"id":"eaba7be4bdcac313","repo":"siyuan-note/siyuan","slug":"347","errorCode":"347","errorMessage":"parse Markdown [%s] failed","messagePattern":"parse Markdown \\[(.+?)\\] failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/import_obsidian.go","lineNumber":876,"sourceCode":"\t\t\treturn newObsidianReadUserError(doc.Source, err)\n\t\t}\n\t\tif !utf8.Valid(data) {\n\t\t\treturn newObsidianUserError(344, doc.Source.RelPath,\n\t\t\t\tfmt.Errorf(\"Markdown [%s] is not valid UTF-8\", doc.Source.RelPath))\n\t\t}\n\t\tscan := scanObsidianSource(data)\n\t\tfor _, blockID := range scan.BlockIDs {\n\t\t\tif scan.Duplicates[blockID] {\n\t\t\t\tdoc.DuplicateBlocks[blockID] = true\n\t\t\t}\n\t\t\tif doc.BlockIDs[blockID] == \"\" {\n\t\t\t\tdoc.BlockIDs[blockID] = ast.NewNodeID()\n\t\t\t}\n\t\t}\n\t\ttree, _, _, _ := parseStdMd(data)\n\t\tif tree == nil {\n\t\t\treturn newObsidianUserError(347, doc.Source.RelPath,\n\t\t\t\tfmt.Errorf(\"parse Markdown [%s] failed\", doc.Source.RelPath))\n\t\t}\n\t\tbuildObsidianHeadingIndex(doc, tree)\n\t\tvault.Analysis.WikiLinkCount += countObsidianNonEmbedTokens(scan.Wikis)\n\t\tvault.Analysis.EmbedCount += countObsidianEmbedTokens(scan.Wikis)\n\t\tvault.Analysis.CommentCount += len(scan.Comments)\n\t\tvault.Analysis.FootnoteCount += scan.Footnotes\n\t\tvault.Analysis.BlockIDCount += len(scan.BlockIDs)\n\t\tprocessed++\n\t\tprogress(35+processed*30/maxInt(sourceCount, 1), \"Analyzing Markdown syntax\")\n\t}\n\n\tfor _, doc := range vault.Docs {\n\t\tif doc.Synthetic {\n\t\t\tcontinue\n\t\t}\n\t\tif err := ctx.Err(); err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":858,"sourceCodeEnd":894,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/import_obsidian.go#L858-L894","documentation":"parseStdMd failed to produce a parse tree for a Vault Markdown document (error code 347), so the analysis phase aborts for that document. The Lute-based standard-Markdown parser returned nil, which the importer treats as an unrecoverable parse failure rather than continuing with a broken tree.","triggerScenarios":"During document analysis, parseStdMd(data) returns tree == nil for doc.Source.RelPath — i.e. the Lute parser rejected the (already UTF-8 validated) content.","commonSituations":"Pathological or deeply nested Markdown that triggers parser limits; corrupted file content; an upstream lute regression for exotic syntax.","solutions":["Open the reported file in a Markdown editor and look for unusual syntax; simplify or split it","Bisect the file content (halve it) to find the construct that breaks parsing","Update SiYuan — the bundled lute parser may have fixed the issue in a newer version","If reproducible, report the file snippet as a lute parser bug"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await importObsidianVault(vaultPath);\n} catch (e) {\n  if (e.code === 347) {\n    const file = /Markdown \\[([^\\]]+)\\]/.exec(e.message)?.[1];\n    console.error('Simplify or repair:', file);\n  }\n}","preventionTips":["Keep notes within mainstream Markdown syntax; avoid pathological nesting","Keep SiYuan updated so the bundled lute parser includes fixes","Bisect problematic files to isolate constructs the parser rejects"],"tags":["obsidian-import","markdown","parser","lute"],"backgroundTag":"schema-validation-failed","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}