{"record":{"id":"a0b56738efbe4a02","repo":"siyuan-note/siyuan","slug":"unsupported-attribute-view-rich-text-node-s","errorCode":null,"errorMessage":"unsupported attribute view rich text node [%s]","messagePattern":"unsupported attribute view rich text node \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/av/value.go","lineNumber":599,"sourceCode":"\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 {\n\t\t\treturn ast.WalkContinue\n\t\t}\n\t\tif !isAllowedValueTextRichNode(node) {\n\t\t\terr = fmt.Errorf(\"unsupported attribute view rich text node [%s]\", node.Type.String())\n\t\t\treturn ast.WalkStop\n\t\t}\n\t\treturn ast.WalkContinue\n\t})\n\treturn\n}\n\n// newValueTextRichLute 固定启用存储格式支持的语法，避免编辑器开关变化后重解释既有数据。\nfunc newValueTextRichLute() *lute.Lute {\n\tret := lute.New()\n\tret.SetTextMark(true)\n\tret.SetEmoji(false)\n\tret.SetProtyleWYSIWYG(true)\n\tret.SetBlockRef(true)\n\tret.SetFileAnnotationRef(true)\n\tret.SetKramdownIAL(true)\n\tret.SetHTMLTag2TextMark(true)\n\tret.SetSuperBlock(true)","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/av/value.go#L581-L617","documentation":"validateValueTextRichTree walks every node of the parsed rich-text tree and requires each node type to pass isAllowedValueTextRichNode — a whitelist of node types considered safe for attribute-view rich text. The first disallowed node type (stringified into the message) aborts the walk with this error, preventing unsafe or non-whitelisted markup from being rendered or persisted.","triggerScenarios":"Parsing rich text whose content produces disallowed AST nodes — e.g. executable or structural inline markup (raw HTML, iframes, script-ish spans, unsupported macros) embedded in the cell content. Reached via ParseValueTextRich, NormalizeValueTextRich, or RenderValueTextRich.","commonSituations":"Pasting rich HTML from web pages into a database cell; content migrated from other tools containing raw HTML; attempts to smuggle scripts/iframe markup into rich text; new Lute versions emitting node types not yet whitelisted.","solutions":["Remove the offending markup named in the message from the cell content and re-enter plain/kramdown formatting","Sanitize pasted HTML before it reaches the cell (paste as plain text)","If a legitimate node type is being rejected, upgrade SiYuan — the whitelist may have been extended in a newer version","Run NormalizeValueTextRich to strip disallowed markup through the kernel's own sanitizer path"],"exampleFix":"// before\nrich.Content = \"<iframe src=\\\"https://evil.example\\\"></iframe>\"\n// after\nrich.Content = \"link text: [example](https://example.com)\" // whitelisted inline markup only","handlingStrategy":"validation","validationCode":"if strings.ContainsAny(content, \"<>\") && !isKnownSafeKramdown(content) {\n    content = stripRawHTML(content) // sanitize before storing\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"unsupported attribute view rich text node\") {\n    // re-save the cell via NormalizeValueTextRich to strip disallowed nodes\n}","preventionTips":["Paste external rich content as plain text","Restrict cell markup to the editor's own formatting toolbar","Route imported content through NormalizeValueTextRich before persistence"],"tags":["attribute-view","rich-text","node-whitelist","sanitization"],"backgroundTag":"schema-validation-failed","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}