Skip to main content

BlockMarkdownSpecOptions

@blockslides/core


@blockslides/core / BlockMarkdownSpecOptions

Interface: BlockMarkdownSpecOptions

Defined in: blockslides/packages/core/src/utilities/markdown/createBlockMarkdownSpec.ts:14

Properties

nodeName

nodeName: string

Defined in: blockslides/packages/core/src/utilities/markdown/createBlockMarkdownSpec.ts:16

The Tiptap node name this spec is for


name?

optional name: string

Defined in: blockslides/packages/core/src/utilities/markdown/createBlockMarkdownSpec.ts:18

The markdown syntax name (defaults to nodeName if not provided)


getContent()?

optional getContent: (token) => string

Defined in: blockslides/packages/core/src/utilities/markdown/createBlockMarkdownSpec.ts:20

Function to extract content from the node for serialization

Parameters

token

MarkdownToken

Returns

string


parseAttributes()?

optional parseAttributes: (attrString) => Record<string, any>

Defined in: blockslides/packages/core/src/utilities/markdown/createBlockMarkdownSpec.ts:22

Function to parse attributes from the attribute string

Parameters

attrString

string

Returns

Record<string, any>


serializeAttributes()?

optional serializeAttributes: (attrs) => string

Defined in: blockslides/packages/core/src/utilities/markdown/createBlockMarkdownSpec.ts:24

Function to serialize attributes to string

Parameters

attrs

Record<string, any>

Returns

string


defaultAttributes?

optional defaultAttributes: Record<string, any>

Defined in: blockslides/packages/core/src/utilities/markdown/createBlockMarkdownSpec.ts:26

Default attributes to apply when parsing


content?

optional content: "inline" | "block"

Defined in: blockslides/packages/core/src/utilities/markdown/createBlockMarkdownSpec.ts:28

Content type: 'block' allows paragraphs/lists/etc, 'inline' only allows bold/italic/links/etc


allowedAttributes?

optional allowedAttributes: string[]

Defined in: blockslides/packages/core/src/utilities/markdown/createBlockMarkdownSpec.ts:30

Allowlist of attributes to include in markdown (if not provided, all attributes are included)