siyuan-note/siyuan · error

unsupported attribute view rich text node [%s]

Error message

unsupported attribute view rich text node [%s]

What it means

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.

Source

Thrown at kernel/av/value.go:599

		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 {
			return ast.WalkContinue
		}
		if !isAllowedValueTextRichNode(node) {
			err = fmt.Errorf("unsupported attribute view rich text node [%s]", node.Type.String())
			return ast.WalkStop
		}
		return ast.WalkContinue
	})
	return
}

// newValueTextRichLute 固定启用存储格式支持的语法,避免编辑器开关变化后重解释既有数据。
func newValueTextRichLute() *lute.Lute {
	ret := lute.New()
	ret.SetTextMark(true)
	ret.SetEmoji(false)
	ret.SetProtyleWYSIWYG(true)
	ret.SetBlockRef(true)
	ret.SetFileAnnotationRef(true)
	ret.SetKramdownIAL(true)
	ret.SetHTMLTag2TextMark(true)
	ret.SetSuperBlock(true)

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Remove the offending markup named in the message from the cell content and re-enter plain/kramdown formatting
  2. Sanitize pasted HTML before it reaches the cell (paste as plain text)
  3. If a legitimate node type is being rejected, upgrade SiYuan — the whitelist may have been extended in a newer version
  4. Run NormalizeValueTextRich to strip disallowed markup through the kernel's own sanitizer path

Example fix

// before
rich.Content = "<iframe src=\"https://evil.example\"></iframe>"
// after
rich.Content = "link text: [example](https://example.com)" // whitelisted inline markup only
Defensive patterns

Strategy: validation

Validate before calling

if strings.ContainsAny(content, "<>") && !isKnownSafeKramdown(content) {
    content = stripRawHTML(content) // sanitize before storing
}

Try / catch

if err != nil && strings.Contains(err.Error(), "unsupported attribute view rich text node") {
    // re-save the cell via NormalizeValueTextRich to strip disallowed nodes
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11). Data as JSON: /api/errors/a0b56738efbe4a02. Report an issue: GitHub.