VisualEditor/Node types

This documents the current state of support for various node types and annotations.

Legend

 * Type
 * symbolic name in the data model;


 * attribute=value
 * used if different values for a certain attribute map to different HTML tags


 * HTML tag
 * HTML tag this node type is converted from/to


 * Valid parents
 * Node types that this type can have as its parent. * means any, - means none


 * Valid children
 * Node types that this type can have as its children. * means any, - means none


 * Other attributes
 * Attributes that have a special meaning for this node type, if any


 * Properties (annotations only)
 * Properties in annotation.data


 * Rendering
 * Whether the editor renders nodes of this type correctly


 * Editing
 * Whether the user can edit the contents of this node type. For annotations, this means the user can edit text with this annotation and change the annotation's properties if any


 * Creating
 * Whether the user can create new nodes of this type. For annotations, this means the user can apply this annotation to existing text


 * Saving
 * Whether a node of this type will be converted back to wikitext correctly. This can be true even for non-editable nodes if they round-trip correctly. A "no" in this column means even untouched nodes of this type don't round-trip correctly

Structural nodes
These nodes can contain child nodes as long as those nodes aren't content nodes. They do not have their own content.

Nodes that can contain content (TODO terminology?)
These nodes can only contain child nodes that are content. They do not have their own content.

Nodes that are content (content nodes?)
These are the only nodes that have content. Text nodes contain text, other nodes in this category cannot contain anything but represent content.

Annotations
These aren't nodes, they're JSON objects, but they do correspond to HTML tags. Annotations can be applied to individual characters in a text node and to other content nodes, but not to non-content nodes. Attribute types are denoted as type/subtype.