Files
AFFiNE-Mirror/blocksuite/affine/shared/src/adapters/index.ts
T
donteatfriedrice 9a721c65b5 feat(editor): add callout block markdown adapter (#12070)
Closes: [BS-3358](https://linear.app/affine-design/issue/BS-3358/remark-callout-plugin)
Closes: [BS-3247](https://linear.app/affine-design/issue/BS-3247/callout-markdown-adapter-适配)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added support for callout blocks in Markdown, enabling recognition and conversion of callout syntax (e.g., `[!emoji]`) to and from block structures.
- **Bug Fixes**
  - Improved handling to distinguish callout blocks from regular blockquotes and paragraphs during Markdown processing.
- **Tests**
  - Introduced comprehensive tests for callout block serialization, deserialization, and plugin behavior to ensure correct Markdown handling.
- **Chores**
  - Added a new dependency for Markdown AST traversal.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-30 05:40:08 +00:00

89 lines
2.5 KiB
TypeScript

export * from './attachment';
export * from './clipboard';
export {
BlockHtmlAdapterExtension,
type BlockHtmlAdapterMatcher,
BlockHtmlAdapterMatcherIdentifier,
type Html,
HtmlAdapter,
HtmlAdapterFactoryExtension,
HtmlAdapterFactoryIdentifier,
HtmlASTToDeltaExtension,
type HtmlASTToDeltaMatcher,
HtmlASTToDeltaMatcherIdentifier,
HtmlDeltaConverter,
InlineDeltaToHtmlAdapterExtension,
type InlineDeltaToHtmlAdapterMatcher,
InlineDeltaToHtmlAdapterMatcherIdentifier,
} from './html';
export * from './image';
export {
BlockMarkdownAdapterExtension,
type BlockMarkdownAdapterMatcher,
BlockMarkdownAdapterMatcherIdentifier,
FOOTNOTE_DEFINITION_PREFIX,
getCalloutEmoji,
getFootnoteDefinitionText,
IN_PARAGRAPH_NODE_CONTEXT_KEY,
InlineDeltaToMarkdownAdapterExtension,
type InlineDeltaToMarkdownAdapterMatcher,
InlineDeltaToMarkdownAdapterMatcherIdentifier,
isCalloutNode,
isFootnoteDefinitionNode,
isMarkdownAST,
type Markdown,
MarkdownAdapter,
MarkdownAdapterFactoryExtension,
MarkdownAdapterFactoryIdentifier,
type MarkdownAdapterPreprocessor,
type MarkdownAST,
MarkdownASTToDeltaExtension,
type MarkdownASTToDeltaMatcher,
MarkdownASTToDeltaMatcherIdentifier,
MarkdownDeltaConverter,
MarkdownPreprocessorExtension,
MarkdownPreprocessorManager,
} from './markdown';
export * from './middlewares';
export * from './mix-text';
export {
BlockNotionHtmlAdapterExtension,
type BlockNotionHtmlAdapterMatcher,
BlockNotionHtmlAdapterMatcherIdentifier,
type InlineDeltaToNotionHtmlAdapterMatcher,
type NotionHtml,
NotionHtmlAdapter,
NotionHtmlAdapterFactoryExtension,
NotionHtmlAdapterFactoryIdentifier,
NotionHtmlASTToDeltaExtension,
type NotionHtmlASTToDeltaMatcher,
NotionHtmlASTToDeltaMatcherIdentifier,
NotionHtmlDeltaConverter,
} from './notion-html';
export * from './notion-text';
export {
BlockPlainTextAdapterExtension,
type BlockPlainTextAdapterMatcher,
BlockPlainTextAdapterMatcherIdentifier,
InlineDeltaToPlainTextAdapterExtension,
type InlineDeltaToPlainTextAdapterMatcher,
InlineDeltaToPlainTextAdapterMatcherIdentifier,
type PlainText,
PlainTextAdapter,
PlainTextAdapterFactoryExtension,
PlainTextAdapterFactoryIdentifier,
PlainTextDeltaConverter,
} from './plain-text';
export {
type AdapterContext,
type AdapterFactory,
AdapterFactoryIdentifier,
type BlockAdapterMatcher,
DeltaASTConverter,
type HtmlAST,
type InlineHtmlAST,
isBlockSnapshotNode,
type TextBuffer,
} from './types';
export * from './utils';