{"record":{"id":"8989ed7320683ae5","repo":"siyuan-note/siyuan","slug":"unsupported-attribute-view-rich-text-format-s","errorCode":null,"errorMessage":"unsupported attribute view rich text format [%s]","messagePattern":"unsupported attribute view rich text format \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/av/value.go","lineNumber":569,"sourceCode":"func ParseValueTextRich(rich *ValueTextRich) (tree *parse.Tree, err error) {\n\t_, tree, err = parseValueTextRich(rich)\n\treturn\n}\n\nfunc parseValueTextRich(rich *ValueTextRich) (blockDOM string, tree *parse.Tree, err error) {\n\treturn parseValueTextRichWithImages(rich, false)\n}\n\nfunc parseValueTextRichWithImages(rich *ValueTextRich, images bool) (blockDOM string, tree *parse.Tree, err error) {\n\tif nil == rich {\n\t\treturn\n\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}","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/av/value.go#L551-L587","documentation":"This error means the Format field of a ValueTextRich is not the supported kramdown format constant ValueTextRichFormatKramdown. The rich text parser only accepts kramdown-encoded content; any other declared format string is rejected before parsing to prevent misinterpreting content stored in an unsupported serialization.","triggerScenarios":"Calling ParseValueTextRich / ParseTableCellRich / normalizeValueTextRichTreeSourceWithImages with ValueTextRich.Format set to anything other than av.ValueTextRichFormatKramdown (e.g. \"markdown\", \"html\", or empty string from incomplete JSON).","commonSituations":"Hand-built API payloads using \"markdown\" instead of \"kramdown\"; older or third-party writers using a different format label; truncated JSON leaving Format empty.","solutions":["Set Format to av.ValueTextRichFormatKramdown (the string constant defined in kernel/av/value.go)","If your content is plain markdown, convert/escape it into kramdown-compatible rich text (text marks with IAL) before storing","Check the JSON source for a renamed field; ensure the format value round-trips through the ValueTextRich struct","For data from another tool/version, re-export the attribute view content through SiYuan's own editor/API so it is re-serialized as kramdown"],"exampleFix":"// before\nrich := &av.ValueTextRich{Spec: av.ValueTextRichSpec, Format: \"markdown\", Content: content}\n// after\nrich := &av.ValueTextRich{Spec: av.ValueTextRichSpec, Format: av.ValueTextRichFormatKramdown, Content: content}","handlingStrategy":"validation","validationCode":"if rich.Format != av.ValueTextRichFormatKramdown { return fmt.Errorf(\"format %q unsupported; expected %q\", rich.Format, av.ValueTextRichFormatKramdown) }","typeGuard":null,"tryCatchPattern":"if _, err := av.ParseValueTextRich(rich); err != nil && strings.Contains(err.Error(), \"unsupported attribute view rich text format\") { rich.Format = av.ValueTextRichFormatKramdown; /* retry or reserialize */ }","preventionTips":["Only use av.ValueTextRichFormatKramdown for rich text values","Never leave Format empty when constructing ValueTextRich literals","Convert plain markdown to editor-emitted kramdown before storing","Add a unit test asserting your serialization writes the kramdown format constant"],"tags":["attribute-view","rich-text","kramdown","format"],"backgroundTag":"invalid-enum-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"}