fix(editor): notion html adapter for embed link block (#9279)

[BS-1745](https://linear.app/affine-design/issue/BS-1745/[bug]-导入的notion-youtube-embed-错误)
This commit is contained in:
donteatfriedrice
2024-12-25 07:20:26 +00:00
parent 2cc7bdfc77
commit 62b930f336
14 changed files with 168 additions and 1 deletions
@@ -2,10 +2,12 @@ import type { ExtensionType } from '@blocksuite/block-std';
import { EmbedGithubBlockHtmlAdapterExtension } from './html.js';
import { EmbedGithubMarkdownAdapterExtension } from './markdown.js';
import { EmbedGithubNotionHtmlAdapterExtension } from './notion-html.js';
import { EmbedGithubBlockPlainTextAdapterExtension } from './plain-text.js';
export const EmbedGithubBlockAdapterExtensions: ExtensionType[] = [
EmbedGithubBlockHtmlAdapterExtension,
EmbedGithubMarkdownAdapterExtension,
EmbedGithubBlockPlainTextAdapterExtension,
EmbedGithubNotionHtmlAdapterExtension,
];
@@ -1,3 +1,4 @@
export * from './html.js';
export * from './markdown.js';
export * from './notion-html.js';
export * from './plain-text.js';
@@ -0,0 +1,14 @@
import { EmbedGithubBlockSchema } from '@blocksuite/affine-model';
import { BlockNotionHtmlAdapterExtension } from '@blocksuite/affine-shared/adapters';
import { createEmbedBlockNotionHtmlAdapterMatcher } from '../../common/adapters/notion-html.js';
import { githubUrlRegex } from '../embed-github-model.js';
export const embedGithubBlockNotionHtmlAdapterMatcher =
createEmbedBlockNotionHtmlAdapterMatcher(
EmbedGithubBlockSchema.model.flavour,
githubUrlRegex
);
export const EmbedGithubNotionHtmlAdapterExtension =
BlockNotionHtmlAdapterExtension(embedGithubBlockNotionHtmlAdapterMatcher);