MarkdownNodeTextWithAttrs

Reference

Node to represent bold text

This node can have children nodes

Patterns

[Hello word]{ id="title" color="blue" }
[This have a **bold text**]{ id="title" color="blue" }

Properties

body

  • Type: string

Plain text containing the content of the node

children

  • Type: NodeArray<MarkdownNode>

Array of children nodes

attrs

  • Type: object

Attributes of the text

Example:

{
    id: "title",
    class: "text-red"
}

toHtml

  • Type: function

Convert the node to Html text

node.toHtml() // `<span ${...attrs}>Content</span>`

// if have children

node.toHtml() // `<span ${...attrs}>{...children.map(c => c.toHtml())}</span>`