Skip to content

Interface: NodeAttribute ​

An attribute an extension adds to other extensions' node types.

Properties ​

PropertyTypeDescription
defaultunknownValue when the attribute is not set.
namestringAttribute name, e.g. 'align'.
parse(element) => unknownRead the value from a pasted or parsed element; undefined means the default.
render(value) => Readonly<Record<string, string>> | nullDOM attributes for a value (a style is appended to the node's own), or null for none.
typesreadonly string[]Node type names, e.g. ['paragraph', 'heading'].
validate?(value) => booleanWhether a value is allowed. A document with any other value does not fit the schema.