Mark

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.

Attributes

AttributeDescription
typeReturns the type of mark this is.
tagNameReturns name for the HTML tag the mark should use.
attrsReturns an array of mark attributes. This will vary for each mark type.

Methods

MethodDescription
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.

Mark Types

Bold

Properties

PropertyValue
typebold
tagNamestrong

Code

Properties

PropertyValue
typecode
tagNamecode

Italic

Properties

PropertyValue
typeitalic
tagNameem

Properties

PropertyValue
typelink
tagNamea

Attributes

These can be accessed via attrs.

AttributeDescription
hrefThe URL for the link.
targetThe target of the link.
relThe rel value for the link.

Strike

Properties

PropertyValue
typestrike
tagNamestrike

Subscript

Properties

PropertyValue
typesubscript
tagNamesub

Superscript

Properties

PropertyValue
typesuperscript
tagNamesup

Underline

Properties

PropertyValue
typeunderline
tagNameu

Previous ← Node Next Node Collection →

Get started with Vizy

Available for Craft 4. Get it from the plugin store.