helpers/wrap_tokens

(require("helpers/wrap_tokens"))(Token, type, container, tokensopt) → {Array.<Token>}

Wrap array of tokens by specified container object.

Source:
Parameters:
Name Type Attributes Default Description
Token Token

markdown-it's Token class.

type String

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

container Object

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

Name Type Attributes Description
tag String

The name of container element.

open Object <optional>

The object assigning to an opening token.

close Object <optional>

The object assigning to a closing token.

tokens Array.<Token> <optional>
[]

Wrapping tokens.

Returns:
Type:
Array.<Token>

Wrapped tokens.