Skip to content

BlockSuite API Documentation / @blocksuite/blocks / MarkdownAdapter

Class: MarkdownAdapter

Extends

Constructors

new MarkdownAdapter(undefined)

new MarkdownAdapter(): MarkdownAdapter

Returns

MarkdownAdapter

Inherited from

BaseAdapter.constructor

Properties

configs

protected configs: Map<string, unknown>

Inherited from

BaseAdapter.configs

Source

packages/framework/store/dist/adapter/base.d.ts:41

Methods

_astToMarkdown()

private _astToMarkdown(ast): string

Parameters

ast: Root

Returns

string

Source

packages/blocks/src/_common/adapters/markdown.ts:1022


_deltaToMdAST()

private _deltaToMdAST(deltas, depth): (Text | Link | Strong | Delete | Emphasis | InlineCode)[]

Parameters

deltas: DeltaInsert[]

depth: number= 0

Returns

(Text | Link | Strong | Delete | Emphasis | InlineCode)[]

Source

packages/blocks/src/_common/adapters/markdown.ts:1036


_markdownToAst()

private _markdownToAst(markdown): Root

Parameters

markdown: string

Returns

Root

Source

packages/blocks/src/_common/adapters/markdown.ts:1032


_mdastToDelta()

private _mdastToDelta(ast): DeltaInsert[]

Parameters

ast: MarkdownAST

Returns

DeltaInsert[]

Source

packages/blocks/src/_common/adapters/markdown.ts:1089


_traverseMarkdown()

private _traverseMarkdown(markdown, snapshot, assets?): Promise<BlockSnapshot>

Parameters

markdown: MarkdownAST

snapshot: BlockSnapshot

assets?: AssetsManager

Returns

Promise<BlockSnapshot>

Source

packages/blocks/src/_common/adapters/markdown.ts:682


_traverseSnapshot()

private _traverseSnapshot(snapshot, markdown, assets?): Promise<object>

Parameters

snapshot: BlockSnapshot

markdown: MarkdownAST

assets?: AssetsManager

Returns

Promise<object>

assetsIds

assetsIds: string[]

ast

ast: Root

Source

packages/blocks/src/_common/adapters/markdown.ts:245


applyConfigs()

applyConfigs(configs): void

Parameters

configs: Map<string, unknown>

Returns

void

Inherited from

BaseAdapter.applyConfigs

Source

packages/framework/store/dist/adapter/base.d.ts:48


fromBlockSnapshot()

fromBlockSnapshot(__namedParameters): Promise<FromBlockSnapshotResult<string>>

Parameters

__namedParameters: FromBlockSnapshotPayload

Returns

Promise<FromBlockSnapshotResult<string>>

Overrides

BaseAdapter.fromBlockSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:72


fromDocSnapshot()

fromDocSnapshot(__namedParameters): Promise<FromDocSnapshotResult<string>>

Parameters

__namedParameters: FromDocSnapshotPayload

Returns

Promise<FromDocSnapshotResult<string>>

Overrides

BaseAdapter.fromDocSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:56


fromSliceSnapshot()

fromSliceSnapshot(__namedParameters): Promise<FromSliceSnapshotResult<string>>

Parameters

__namedParameters: FromSliceSnapshotPayload

Returns

Promise<FromSliceSnapshotResult<string>>

Overrides

BaseAdapter.fromSliceSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:91


toBlockSnapshot()

toBlockSnapshot(payload): Promise<BlockSnapshot>

Parameters

payload: ToBlockSnapshotPayload<string>

Returns

Promise<BlockSnapshot>

Overrides

BaseAdapter.toBlockSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:177


toDocSnapshot()

toDocSnapshot(payload): Promise<DocSnapshot>

Parameters

payload: ToDocSnapshotPayload<string>

Returns

Promise<DocSnapshot>

Overrides

BaseAdapter.toDocSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:118


toSliceSnapshot()

toSliceSnapshot(payload): Promise<null | SliceSnapshot>

Parameters

payload: MarkdownToSliceSnapshotPayload

Returns

Promise<null | SliceSnapshot>

Overrides

BaseAdapter.toSliceSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:201