{"record":{"id":"e2dde3e2ec83e27e","repo":"siyuan-note/siyuan","slug":"parse-attribute-view-rich-text-failed","errorCode":null,"errorMessage":"parse attribute view rich text failed","messagePattern":"parse attribute view rich text failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/av/value.go","lineNumber":577,"sourceCode":"\t}\n\tif ValueTextRichSpec != rich.Spec {\n\t\terr = fmt.Errorf(\"unsupported attribute view rich text spec [%d]\", rich.Spec)\n\t\treturn\n\t}\n\tif ValueTextRichFormatKramdown != rich.Format {\n\t\terr = fmt.Errorf(\"unsupported attribute view rich text format [%s]\", rich.Format)\n\t\treturn\n\t}\n\n\tluteEngine := newValueTextRichLute()\n\tcontent, protectedStyleEntities, protectErr := protectValueTextRichKramdownStyleEntities(rich.Content)\n\tif nil != protectErr {\n\t\terr = protectErr\n\t\treturn\n\t}\n\tblockDOM, tree = luteEngine.Md2BlockDOMTree(content, true)\n\tif nil == tree || nil == tree.Root {\n\t\terr = fmt.Errorf(\"parse attribute view rich text failed\")\n\t\treturn\n\t}\n\tif 0 < len(protectedStyleEntities) {\n\t\tif err = restoreValueTextRichTreeStyleEntities(tree, protectedStyleEntities); nil != err {\n\t\t\treturn\n\t\t}\n\t\tblockDOM = luteEngine.Tree2BlockDOM(tree, luteEngine.RenderOptions, luteEngine.ParseOptions)\n\t}\n\terr = validateValueTextRichTree(tree)\n\treturn\n}\n\nfunc validateValueTextRichTree(tree *parse.Tree) (err error) {\n\tif nil == tree || nil == tree.Root {\n\t\treturn fmt.Errorf(\"attribute view rich text tree is missing\")\n\t}\n\tast.Walk(tree.Root, func(node *ast.Node, entering bool) ast.WalkStatus {\n\t\tif !entering {","sourceCodeStart":559,"sourceCodeEnd":595,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/av/value.go#L559-L595","documentation":"parseValueTextRich feeds the kramdown content through luteEngine.Md2BlockDOMTree and expects a non-nil tree with a non-nil root. If Lute returns nil (or a tree without a root) the function cannot proceed and returns this generic parse-failure error, indicating the content could not be turned into a valid block DOM tree.","triggerScenarios":"Md2BlockDOMTree returning nil/empty for the (style-entity-protected) kramdown content — e.g. content that reduces to nothing after entity protection, or a Lute engine initialized in an unexpected state. Reached via ParseValueTextRich or NormalizeValueTextRich.","commonSituations":"Rich-text content consisting only of exotic constructs that the protection layer rewrites away; corrupted cell content in the database; Lute version drift between the persisted markup dialect and the engine.","solutions":["Inspect and repair the rich.Content string — re-enter the cell text in the SiYuan UI","Simplify the content: strip unusual inline markup and re-add formatting incrementally","Restore the cell from a backup/snapshot taken before the content was corrupted","Check the Lute/lute.min.js version matches the kernel build and update if drifted"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"blockDOM, tree, err := av.ParseValueTextRich(rich)\nif err != nil {\n    // fall back to plain text: use rich.Content stripped of markup\n}","preventionTips":["Keep the cell content to ordinary inline kramdown; avoid exotic constructs","Keep Lute and the kernel versions in sync","Back up the database before bulk-editing rich-text cells"],"tags":["attribute-view","rich-text","parse-failure","lute"],"backgroundTag":"invalid-argument-format","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}