Changes from V4:
isHovering to track whether the user is already hovering over a group,
so that we don't reapply hover styles when the user toggles a highlight.Blur to MouseOut to be more consistent with MouseOver and because it's
not really a blur event.Highlighter provides a view/model/update to display a view to highlight text and show marks.
selectShortest for the normal case of 0 or 1 highlight.Messages used by highlighter when interacting with a mouse or finger.
Setup initial model
joinAdjacentInteractiveHighlights - When true, and static highlightables are sandwiched by highlighted interactive highlightables of the same type, apply the highlight to the static highlightable as well.
Update for highlighter returning additional info about whether there was a change
Same as view, but will render strings like "blah" inside of emphasis tags.
WARNING: the version of markdown used here is extremely limited, as the highlighter content needs to be entirely in-line content. Lists & other block-level elements will not render as they usually would!
WARNING: markdown is rendered highlightable by highlightable, so be sure to provide highlightables like ["New York Times"]["New York Times"], NOT like ["New ", "York ", "Times"]["New ", "York ", "Times"]
Same as static, but will render strings like "blah" inside of emphasis tags.
WARNING: the version of markdown used here is extremely limited, as the highlighter content needs to be entirely in-line content. Lists & other block-level elements will not render as they usually would!
WARNING: markdown is rendered highlightable by highlightable, so be sure to provide highlightables like ["New York Times"]["New York Times"], NOT like ["New ", "York ", "Times"]["New ", "York ", "Times"]
Same as staticWithTags, but will render strings like "blah" inside of emphasis tags.
WARNING: the version of markdown used here is extremely limited, as the highlighter content needs to be entirely in-line content. Lists & other block-level elements will not render as they usually would!
WARNING: markdown is rendered highlightable by highlightable, so be sure to provide highlightables like ["New York Times"]["New York Times"], NOT like ["New ", "York ", "Times"]["New ", "York ", "Times"]
Possible intents or "external effects" that the Highlighter can request (see perform).
Check if the highlighter has changed.
You are not likely to need this helper unless you're working with inline commenting.
You are not likely to need this helper unless you're working with inline commenting.
Highlights can overlap. Sometimes, we want to apply a certain behavior (e.g., hover color change) on just the shortest highlight. Use this function to find out which marker applies to the least amount of text.
Note that this is shortest by text length, not shortest by number of highlightables.
You are not likely to need this helper unless you're working with inline commenting.
Model of a highlighter