Skip to content

API > @blocksuite/store > MarkdownAdapter

Class: MarkdownAdapter ​

Extends ​

Constructors ​

constructor ​

new MarkdownAdapter(): MarkdownAdapter

Returns ​

MarkdownAdapter

Inherited from ​

BaseAdapter.constructor

Methods ​

_astToMardown ​

private _astToMardown(ast): string

Parameters ​

ParameterType
astRoot

Returns ​

string

Defined In ​

packages/store/src/adapter/markdown.ts:733


_deltaToMdAST ​

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

Parameters ​

ParameterTypeDefault value
deltasDeltaInsert[]undefined
depthnumber0

Returns ​

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

Defined In ​

packages/store/src/adapter/markdown.ts:741


_markdownToAst ​

private _markdownToAst(markdown): Root

Parameters ​

ParameterType
markdownstring

Returns ​

Root

Defined In ​

packages/store/src/adapter/markdown.ts:737


_mdastToDelta ​

private _mdastToDelta(ast): DeltaInsert[]

Parameters ​

ParameterType
astMarkdownAST

Returns ​

DeltaInsert[]

Defined In ​

packages/store/src/adapter/markdown.ts:787


_traverseMarkdown ​

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

Parameters ​

ParameterType
markdownMarkdownAST
snapshotBlockSnapshot
assets?AdapterAssetsManager

Returns ​

Promise< BlockSnapshot >

Defined In ​

packages/store/src/adapter/markdown.ts:430


_traverseSnapshot ​

private _traverseSnapshot( snapshot, markdown, assets?): Promise< {assetsIds: string[]; ast: Root;} >

Parameters ​

ParameterType
snapshotBlockSnapshot
markdownMarkdownAST
assets?AdapterAssetsManager

Returns ​

Promise< {assetsIds: string[]; ast: Root;} >

Defined In ​

packages/store/src/adapter/markdown.ts:191


fromBlockSnapshot ​

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

Parameters ​

ParameterType
__namedParametersFromBlockSnapshotPayload

Returns ​

Promise< FromBlockSnapshotResult< string > >

Overrides ​

BaseAdapter.fromBlockSnapshot

Defined In ​

packages/store/src/adapter/markdown.ts:72


fromPageSnapshot ​

fromPageSnapshot(__namedParameters): Promise< FromPageSnapshotResult< string > >

Parameters ​

ParameterType
__namedParametersFromPageSnapshotPayload

Returns ​

Promise< FromPageSnapshotResult< string > >

Overrides ​

BaseAdapter.fromPageSnapshot

Defined In ​

packages/store/src/adapter/markdown.ts:53


fromSliceSnapshot ​

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

Parameters ​

ParameterType
__namedParametersFromSliceSnapshotPayload

Returns ​

Promise< FromSliceSnapshotResult< string > >

Overrides ​

BaseAdapter.fromSliceSnapshot

Defined In ​

packages/store/src/adapter/markdown.ts:91


toBlockSnapshot ​

toBlockSnapshot(payload): Promise< BlockSnapshot >

Parameters ​

ParameterType
payloadToBlockSnapshotPayload< string >

Returns ​

Promise< BlockSnapshot >

Overrides ​

BaseAdapter.toBlockSnapshot

Defined In ​

packages/store/src/adapter/markdown.ts:145


toPageSnapshot ​

toPageSnapshot(payload): Promise< PageSnapshot >

Parameters ​

ParameterType
payloadToPageSnapshotPayload< string >

Returns ​

Promise< PageSnapshot >

Overrides ​

BaseAdapter.toPageSnapshot

Defined In ​

packages/store/src/adapter/markdown.ts:118


toSliceSnapshot ​

toSliceSnapshot(payload): Promise< SliceSnapshot >

Parameters ​

ParameterType
payloadMarkdownToSliceSnapshotPayload

Returns ​

Promise< SliceSnapshot >

Overrides ​

BaseAdapter.toSliceSnapshot

Defined In ​

packages/store/src/adapter/markdown.ts:163