BlockSuite API Documentation / @blocksuite/blocks / MarkdownAdapter
Class: MarkdownAdapter
Extends
Constructors
new MarkdownAdapter()
new MarkdownAdapter():
MarkdownAdapter
Returns
Inherited from
Properties
configs
protected
configs:Map
<string
,unknown
>
Inherited from
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:1051
_deltaToMdAST()
private
_deltaToMdAST(deltas
,depth
): (Text
|Link
|Strong
|Delete
|Emphasis
|InlineCode
)[]
Parameters
• deltas: DeltaInsert
<AffineTextAttributes
>[]
• depth: number
= 0
Returns
(Text
| Link
| Strong
| Delete
| Emphasis
| InlineCode
)[]
Source
packages/blocks/src/_common/adapters/markdown.ts:1065
_markdownToAst()
private
_markdownToAst(markdown
):Root
Parameters
• markdown: string
Returns
Root
Source
packages/blocks/src/_common/adapters/markdown.ts:1061
_mdastToDelta()
private
_mdastToDelta(ast
):DeltaInsert
[]
Parameters
• ast: MarkdownAST
Returns
Source
packages/blocks/src/_common/adapters/markdown.ts:1132
_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:711
_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:278
applyConfigs()
applyConfigs(
configs
):void
Parameters
• configs: Map
<string
, unknown
>
Returns
void
Inherited from
Source
packages/framework/store/dist/adapter/base.d.ts:48
fromBlockSnapshot()
fromBlockSnapshot(
__namedParameters
):Promise
<FromBlockSnapshotResult
<string
>>
Parameters
• __namedParameters: FromBlockSnapshotPayload
Returns
Promise
<FromBlockSnapshotResult
<string
>>
Overrides
Source
packages/blocks/src/_common/adapters/markdown.ts:73
fromDocSnapshot()
fromDocSnapshot(
__namedParameters
):Promise
<FromDocSnapshotResult
<string
>>
Parameters
• __namedParameters: FromDocSnapshotPayload
Returns
Promise
<FromDocSnapshotResult
<string
>>
Overrides
Source
packages/blocks/src/_common/adapters/markdown.ts:57
fromSliceSnapshot()
fromSliceSnapshot(
__namedParameters
):Promise
<FromSliceSnapshotResult
<string
>>
Parameters
• __namedParameters: FromSliceSnapshotPayload
Returns
Promise
<FromSliceSnapshotResult
<string
>>
Overrides
Source
packages/blocks/src/_common/adapters/markdown.ts:92
toBlockSnapshot()
toBlockSnapshot(
payload
):Promise
<BlockSnapshot
>
Parameters
• payload: ToBlockSnapshotPayload
<string
>
Returns
Promise
<BlockSnapshot
>
Overrides
Source
packages/blocks/src/_common/adapters/markdown.ts:178
toDocSnapshot()
toDocSnapshot(
payload
):Promise
<DocSnapshot
>
Parameters
• payload: ToDocSnapshotPayload
<string
>
Returns
Promise
<DocSnapshot
>
Overrides
Source
packages/blocks/src/_common/adapters/markdown.ts:119
toSliceSnapshot()
toSliceSnapshot(
payload
):Promise
<null
|SliceSnapshot
>
Parameters
• payload: MarkdownToSliceSnapshotPayload
Returns
Promise
<null
| SliceSnapshot
>
Overrides
Source
packages/blocks/src/_common/adapters/markdown.ts:202