mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 14:28:51 +08:00
f99b143bf9
Closes: [BS-3525](https://linear.app/affine-design/issue/BS-3525/markdown-adapter-紧跟着链接的-footnote-reference-会被识别成链接的一部分) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved handling of footnote references that immediately follow URLs in markdown, ensuring correct spacing and parsing. - **Bug Fixes** - Footnote references after URLs are now parsed correctly, preventing formatting issues. - **Tests** - Added comprehensive test suites to verify footnote reference preprocessing and markdown conversion. - **Chores** - Introduced Vitest as a development dependency and added a dedicated test configuration for the footnote module. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
22 lines
680 B
TypeScript
22 lines
680 B
TypeScript
import {
|
|
type StoreExtensionContext,
|
|
StoreExtensionProvider,
|
|
} from '@blocksuite/affine-ext-loader';
|
|
|
|
import {
|
|
footnoteReferenceDeltaToMarkdownAdapterMatcher,
|
|
FootnoteReferenceMarkdownPreprocessorExtension,
|
|
markdownFootnoteReferenceToDeltaMatcher,
|
|
} from './adapters';
|
|
|
|
export class FootnoteStoreExtension extends StoreExtensionProvider {
|
|
override name = 'affine-footnote-inline';
|
|
|
|
override setup(context: StoreExtensionContext) {
|
|
super.setup(context);
|
|
context.register(markdownFootnoteReferenceToDeltaMatcher);
|
|
context.register(footnoteReferenceDeltaToMarkdownAdapterMatcher);
|
|
context.register(FootnoteReferenceMarkdownPreprocessorExtension);
|
|
}
|
|
}
|