PropertyAnnotation
Class defined in model/PropertyAnnotation.js#31 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',
        path: ['p1', 'content'],
        "startOffset": 10,
        "endOffset": 19
      })
    })

this.getText()
Method defined in model/PropertyAnnotation.js#38

Get the plain text spanned by this annotation.

Returns

String |

this.canSplit()
Method defined in model/PropertyAnnotation.js#56

Determines if an annotation can be split e.g., when breaking a node.

In these cases, a new annotation will be created attached to the created node.

For certain annotation types,you may want to the annotation truncated rather than split, where you need to override this method returning `false`.

this.isAnchor()
Method defined in model/PropertyAnnotation.js#69

If this annotation is a an Anchor.

Anchors are annotations with a zero width. For instance, ContainerAnnotation have a start and an end anchor, or rendered cursors are modeled as anchors.

Returns

Boolean |