Skip to main content

extension-text-highlight

package @remirror/extension-text-highlight

class TextHighlightExtension

Add a highlight color to the selected text (or text within a specified range).

Signature:

export declare class TextHighlightExtension extends MarkExtension<TextHighlightOptions> 

Extends: MarkExtension<TextHighlightOptions>

(Some inherited members may not be shown because they are not represented in the documentation.)

property name

Signature:

get name(): "textHighlight";

method createMarkSpec

Signature:

createMarkSpec(extra: ApplySchemaAttributes, override: MarkSpecOverride): MarkExtensionSpec;

Parameters:

ParameterTypeDescription
extraApplySchemaAttributes
overrideMarkSpecOverride

Returns:

MarkExtensionSpec

method createTags

Signature:

createTags(): ("formattingMark" | "fontStyle")[];

Returns:

("formattingMark" | "fontStyle")[]

method removeTextHighlight

Remove the highlight mark from the selection.

Signature:

removeTextHighlight(options?: HighlightCommandOptions): CommandFunction;

Parameters:

ParameterTypeDescription
optionsHighlightCommandOptions(Optional)

Returns:

CommandFunction

method setTextHighlight

Set the text highlight color value for the selected text.

Signature:

setTextHighlight(highlight: string, options?: HighlightCommandOptions): CommandFunction;

Parameters:

ParameterTypeDescription
highlightstring
optionsHighlightCommandOptions(Optional)

Returns:

CommandFunction

interface TextHighlightAttributes

Signature:

export interface TextHighlightAttributes 

property highlight

The highlight color.

Signature:

highlight?: string;

interface TextHighlightOptions

Signature:

export interface TextHighlightOptions 

property defaultHighlight

The default highlight value.

Signature:

defaultHighlight?: Static<string>;

property palette

The color palette which is a function that returns a list of colors and labels for help with ui. It is completely optional and you are free to use use whatever colors you choose.

Signature:

palette?: Palette;