Classes
AbstractEditorAnnotationCommandCommandComponentConfiguratorContainerEditorContainerSelectionDOMImporterDocumentDocumentNodeEditAnnotationCommandEditingEventEmitterInsertInlineNodeCommandNodeIndexPropertyAnnotationPropertySelectionProseEditorScrollPaneSelectionSpellCheckCommandSurfaceTextNodeTransactionDocumentVirtualElement
Components
Modules
PropertyAnnotation
Class defined in model/PropertyAnnotation.js#38 inherits from
A property annotation can be used to overlay text and give it a special meaning. PropertyAnnotations only work on text properties. If you want to annotate multiple nodes you have to use a model/ContainerAnnotation.
Example
Here's how a strong annotation is created. In Substance annotations are stored
separately from the text. Annotations are just regular nodes in the document.
They refer to a certain range (startOffset, endOffset
) in a text property (path
).
doc.transaction(function(tx) {
tx.create({
id: 's1',
type: 'strong',
start: {
path: ['p1', 'content'],
offset: 10
},
end: {
offset
}
path: ['p1', 'content'],
"startOffset": 10,
"endOffset": 19
})
})