extension-bold
package @remirror/extension-bold
class BoldExtension
When added to your editor it will provide the toggleBold
command which makes the text under the cursor / or at the provided position range bold.
Signature:
export declare class BoldExtension extends MarkExtension<BoldOptions>
Extends: MarkExtension<BoldOptions>
(Some inherited members may not be shown because they are not represented in the documentation.)
property name
Signature:
get name(): "bold";
method createInputRules
Signature:
createInputRules(): InputRule[];
Returns:
InputRule[]
method createMarkSpec
Signature:
createMarkSpec(extra: ApplySchemaAttributes, override: MarkSpecOverride): MarkExtensionSpec;
Parameters:
Parameter | Type | Description |
---|---|---|
extra | ApplySchemaAttributes | |
override | MarkSpecOverride |
Returns:
method createTags
Signature:
createTags(): ("formattingMark" | "fontStyle")[];
Returns:
("formattingMark" | "fontStyle")[]
method removeBold
Remove the bold formatting from the provided range.
Signature:
removeBold(selection?: PrimitiveSelection): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
selection | PrimitiveSelection | (Optional) |
Returns:
CommandFunction
method setBold
Set the bold formatting for the provided range.
Signature:
setBold(selection?: PrimitiveSelection): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
selection | PrimitiveSelection | (Optional) |
Returns:
CommandFunction
method shortcut
Attach the keyboard shortcut for making text bold to this mark and also to the toggleBold
command.
Signature:
shortcut(props: KeyBindingProps): boolean;
Parameters:
Parameter | Type | Description |
---|---|---|
props | KeyBindingProps |
Returns:
boolean
method toggleBold
Toggle the bold styling on and off. Remove the formatting if any matching bold formatting within the selection or provided range.
Signature:
toggleBold(selection?: PrimitiveSelection): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
selection | PrimitiveSelection | (Optional) |
Returns:
CommandFunction
interface BoldOptions
Signature:
export interface BoldOptions
property weight
Optionally set the font weight property for this extension.
Signature:
weight?: Static<FontWeightProperty>;