mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
feat(editor): support footnote adapter (#9844)
[BS-2373](https://linear.app/affine-design/issue/BS-2373/适配-footnote-adapter)
This commit is contained in:
@@ -20,6 +20,7 @@ export {
|
||||
BlockMarkdownAdapterExtension,
|
||||
type BlockMarkdownAdapterMatcher,
|
||||
BlockMarkdownAdapterMatcherIdentifier,
|
||||
FOOTNOTE_DEFINITION_PREFIX,
|
||||
InlineDeltaToMarkdownAdapterExtension,
|
||||
type InlineDeltaToMarkdownAdapterMatcher,
|
||||
InlineDeltaToMarkdownAdapterMatcherIdentifier,
|
||||
|
||||
@@ -4,9 +4,12 @@ MIT License
|
||||
Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com>
|
||||
|
||||
mdast-util-gfm-autolink-literal is from markdown only.
|
||||
mdast-util-gfm-footnote is not included.
|
||||
*/
|
||||
import { gfmAutolinkLiteralFromMarkdown } from 'mdast-util-gfm-autolink-literal';
|
||||
import {
|
||||
gfmFootnoteFromMarkdown,
|
||||
gfmFootnoteToMarkdown,
|
||||
} from 'mdast-util-gfm-footnote';
|
||||
import {
|
||||
gfmStrikethroughFromMarkdown,
|
||||
gfmStrikethroughToMarkdown,
|
||||
@@ -17,6 +20,7 @@ import {
|
||||
gfmTaskListItemToMarkdown,
|
||||
} from 'mdast-util-gfm-task-list-item';
|
||||
import { gfmAutolinkLiteral } from 'micromark-extension-gfm-autolink-literal';
|
||||
import { gfmFootnote } from 'micromark-extension-gfm-footnote';
|
||||
import { gfmStrikethrough } from 'micromark-extension-gfm-strikethrough';
|
||||
import { gfmTable } from 'micromark-extension-gfm-table';
|
||||
import { gfmTaskListItem } from 'micromark-extension-gfm-task-list-item';
|
||||
@@ -29,6 +33,7 @@ export function gfm() {
|
||||
gfmStrikethrough(),
|
||||
gfmTable(),
|
||||
gfmTaskListItem(),
|
||||
gfmFootnote(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -38,6 +43,7 @@ function gfmFromMarkdown() {
|
||||
gfmTableFromMarkdown(),
|
||||
gfmTaskListItemFromMarkdown(),
|
||||
gfmAutolinkLiteralFromMarkdown(),
|
||||
gfmFootnoteFromMarkdown(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -47,6 +53,7 @@ function gfmToMarkdown() {
|
||||
gfmStrikethroughToMarkdown(),
|
||||
gfmTableToMarkdown(),
|
||||
gfmTaskListItemToMarkdown(),
|
||||
gfmFootnoteToMarkdown(),
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,3 +15,5 @@ export const isMarkdownAST = (node: unknown): node is MarkdownAST =>
|
||||
!Array.isArray(node) &&
|
||||
'type' in (node as object) &&
|
||||
(node as MarkdownAST).type !== undefined;
|
||||
|
||||
export const FOOTNOTE_DEFINITION_PREFIX = 'footnoteDefinition:';
|
||||
|
||||
Reference in New Issue
Block a user