This is a lower-level API. Lower-level APIs are not recommended for most projects, and may not be available on all plans. See our page on recommended deployment patterns for more information.
Public Method Annotations API

applyHighlight()

Highlights certain text based on provided information. If the provided startContainerPath and endContainerPath start with an id prefix like “[id^=”passage_”]>p:nth-of-type(2);0”, then of all the elements that have ids matching [id^=”passage_”] such as id='passage_0' or id='passage_1' will be highlighted.

Examples

app.module('texthighlight').applyHighlight({
    id: 'myNote',
    startContainerPath: 'div:nth-of-type(1)>p:nth-of-type(2);0',
    endContainerPath: 'div:nth-of-type(1)>p:nth-of-type(2);0',
    startOffset: 297,
    endOffset: 538
});

Arguments

  • id string

    A unique string value up to 150 characters in length.

  • startContainerPath string

    The beginning of the container path.

  • endContainerPath string

    The end of the container path.

  • startOffset string

    The beginning of the offset, a value in pixels.

  • endOffset string

    The end of the offset, a value in pixels.

Return value

None (undefined).

Was this article helpful?