siyuan-note/siyuan · error
parse attribute view rich text failed
Error message
parse attribute view rich text failed
What it means
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.
Source
Thrown at kernel/av/value.go:577
}
if ValueTextRichSpec != rich.Spec {
err = fmt.Errorf("unsupported attribute view rich text spec [%d]", rich.Spec)
return
}
if ValueTextRichFormatKramdown != rich.Format {
err = fmt.Errorf("unsupported attribute view rich text format [%s]", rich.Format)
return
}
luteEngine := newValueTextRichLute()
content, protectedStyleEntities, protectErr := protectValueTextRichKramdownStyleEntities(rich.Content)
if nil != protectErr {
err = protectErr
return
}
blockDOM, tree = luteEngine.Md2BlockDOMTree(content, true)
if nil == tree || nil == tree.Root {
err = fmt.Errorf("parse attribute view rich text failed")
return
}
if 0 < len(protectedStyleEntities) {
if err = restoreValueTextRichTreeStyleEntities(tree, protectedStyleEntities); nil != err {
return
}
blockDOM = luteEngine.Tree2BlockDOM(tree, luteEngine.RenderOptions, luteEngine.ParseOptions)
}
err = validateValueTextRichTree(tree)
return
}
func validateValueTextRichTree(tree *parse.Tree) (err error) {
if nil == tree || nil == tree.Root {
return fmt.Errorf("attribute view rich text tree is missing")
}
ast.Walk(tree.Root, func(node *ast.Node, entering bool) ast.WalkStatus {
if !entering {View on GitHub (pinned to 8641553a1f)
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
Defensive patterns
Strategy: try-catch
Try / catch
blockDOM, tree, err := av.ParseValueTextRich(rich)
if err != nil {
// fall back to plain text: use rich.Content stripped of markup
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- ErrRichTextSpecMismatch
- unsupported attribute view rich text spec [%d]
- unsupported attribute view rich text format [%s]
- attribute view rich text tree is missing
- unsupported attribute view rich text node [%s]
AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11).
Data as JSON: /api/errors/e2dde3e2ec83e27e.
Report an issue: GitHub.