A mark object represents inline styles that can be applied to certain nodes. Marks cannot be used outside of the context of a Node.
A common example of a Mark would be Bold text within a Paragraph node.
Each Mark shares the following attributes and methods.
Attribute | Description |
type | Returns the type of mark this is. |
tagName | Returns name for the HTML tag the mark should use. |
attrs | Returns an array of mark attributes. This will vary for each mark type. |
Method | Description |
getTag() | Returns the HTML tag name and attributes the mark should use for the HTML tag. |
getAttrs() | Returns an array of mark attributes. This will vary for each mark type. |
getType() | Returns the type of mark this is. |
renderOpeningTag() | Renders the opening tag for the mark. |
renderClosingTag() | Renders the closing tag for the mark. |
Property | Value |
type | bold |
tagName | strong |
Property | Value |
type | code |
tagName | code |
Property | Value |
type | italic |
tagName | em |
Property | Value |
type | link |
tagName | a |
These can be accessed via attrs
.
Attribute | Description |
href | The URL for the link. |
target | The target of the link. |
rel | The rel value for the link. |
Property | Value |
type | strike |
tagName | strike |
Property | Value |
type | subscript |
tagName | sub |
Property | Value |
type | superscript |
tagName | sup |
Property | Value |
type | textStyle |
tagName | span |
Property | Value |
type | underline |
tagName | u |