{"record":{"id":"8bf9493a23d185d1","repo":"siyuan-note/siyuan","slug":"unsupported-attribute-view-rich-text-style","errorCode":null,"errorMessage":"unsupported attribute view rich text style","messagePattern":"unsupported attribute view rich text style","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/av/value.go","lineNumber":1289,"sourceCode":"\t}\n\tmatch := valueTextRichBuiltinStylePattern.FindStringSubmatch(value)\n\tif 5 != len(match) || match[1] != match[3] || match[2] != valueSuffix || match[4] != legacySuffix {\n\t\treturn \"\", false\n\t}\n\treturn fmt.Sprintf(\"var(--b3-inline-builtin-%s-%s, var(--b3-card-%s-%s))\",\n\t\tmatch[1], valueSuffix, match[1], legacySuffix), true\n}\n\nfunc normalizeValueTextRichTreeStyles(tree *parse.Tree) (err error) {\n\tast.Walk(tree.Root, func(node *ast.Node, entering bool) ast.WalkStatus {\n\t\tif !entering || ast.NodeTextMark != node.Type || 1 > len(node.KramdownIAL) {\n\t\t\treturn ast.WalkContinue\n\t\t}\n\t\tstyle := node.IALAttr(\"style\")\n\t\tvar normalized string\n\t\tvar ok bool\n\t\tif normalized, ok = normalizeValueTextRichStyle(style); !ok {\n\t\t\terr = fmt.Errorf(\"unsupported attribute view rich text style\")\n\t\t\treturn ast.WalkStop\n\t\t}\n\t\tnode.SetIALAttr(\"style\", normalized)\n\t\tnode.Next.Tokens = parse.IAL2Tokens(node.KramdownIAL)\n\t\treturn ast.WalkContinue\n\t})\n\treturn\n}\n\nfunc isAllowedValueTextRichBlockIAL(node *ast.Node) bool {\n\tial := parse.Tokens2IAL(node.Tokens)\n\tif 1 > len(ial) {\n\t\treturn false\n\t}\n\thasID := false\n\tfor _, attr := range ial {\n\t\tif 2 != len(attr) {\n\t\t\treturn false","sourceCodeStart":1271,"sourceCodeEnd":1307,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/av/value.go#L1271-L1307","documentation":"While normalizing kramdown IAL styles on the rich text tree, normalizeValueTextRichStyle could not normalize a node's style attribute into the allowed style set. The kernel enforces an allowlist of CSS properties on rich text spans; a style declaration outside that set (or malformed) aborts the walk with this error, keeping stored styles limited to editor-supported properties.","triggerScenarios":"Rich text content whose span style IAL contains a non-allowed CSS property/value (e.g. custom style=\"color:red;font-size:99px\" or an unrecognized property), reaching the normalization walk via parseValueTextRichWithImages/restore/validate paths declared around kernel/av/value.go:1289.","commonSituations":"Data written by plugins or older versions using styles the current allowlist rejects; hand-edited .sy/DB content; copying styled content from other tools; a pasted span with arbitrary CSS.","solutions":["Edit the cell in the SiYuan editor and re-apply the style from the editor's toolbar so the style is regenerated from the allowlist","Remove or reduce the offending style attribute to supported properties (e.g. standard color/background/weight values the editor emits)","Check kernel/av/value.go normalizeValueTextRichStyle for the accepted style set and adjust content to match","If content came from a newer version with more style properties, upgrade the kernel so the allowlist covers it"],"exampleFix":"// before\n{: style=\"position:absolute;top:0;\"}\n// after\n{: style=\"color:#f00;\"}","handlingStrategy":"validation","validationCode":"// only emit styles the editor produces; allowlist check before storing\nallowed := map[string]bool{\"color\": true, \"background-color\": true, \"font-weight\": true}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Apply styling through the SiYuan editor toolbar, not by editing kramdown IALs","Compare custom styles against normalizeValueTextRichStyle's accepted set before persisting","Avoid copying rich CSS from external tools into cell content","Pin kernel version expectations when migrating data between installs"],"tags":["attribute-view","rich-text","css","style-validation"],"backgroundTag":"invalid-config-value","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"}