Methods

(static) wrapTokens(Token, type, container, tokensopt) → {Array.<Token>}

Wrap array of tokens by specified container object.

Parameters:
NameTypeAttributesDefaultDescription
TokenToken

markdown-it's Token class.

typeString

Token type. It will be suffixed by _open / _close.

containerObject

A container object to wrap tokens, includes tag name and attributes.

Properties
NameTypeAttributesDescription
tagString

The name of container element.

openObject<optional>

The object assigning to an opening token.

closeObject<optional>

The object assigning to a closing token.

tokensArray.<Token><optional>
[]

Wrapping tokens.

Returns:

Wrapped tokens.

Type: 
Array.<Token>