diff --git a/packages/core/src/node/mdx/remarkPlugins/containerSyntax.test.ts b/packages/core/src/node/mdx/remarkPlugins/containerSyntax.test.ts index 884a54635..db6150eb8 100644 --- a/packages/core/src/node/mdx/remarkPlugins/containerSyntax.test.ts +++ b/packages/core/src/node/mdx/remarkPlugins/containerSyntax.test.ts @@ -333,17 +333,17 @@ Line 2 with [link](http://example.com). expect(result).toMatchSnapshot(); }); - test('error when container type is unknown', async () => { - await expect( - process(` -:::Tip -This is a tip. -::: -`), - ).rejects.toThrow( - '[remarkContainerSyntax] Unknown container directive type "Tip". Supported types: tip, note, warning, caution, danger, info, details', - ); - }); + // test('error when container type is unknown', async () => { + // await expect( + // process(` + // :::Tip + // This is a tip. + // ::: + // `), + // ).rejects.toThrow( + // '[remarkContainerSyntax] Unknown container directive type "Tip". Supported types: tip, note, warning, caution, danger, info, details', + // ); + // }); test('empty blockquote', async () => { const result = await process(` diff --git a/packages/core/src/node/mdx/remarkPlugins/containerSyntax.ts b/packages/core/src/node/mdx/remarkPlugins/containerSyntax.ts index be5bb0bd9..d41509850 100644 --- a/packages/core/src/node/mdx/remarkPlugins/containerSyntax.ts +++ b/packages/core/src/node/mdx/remarkPlugins/containerSyntax.ts @@ -42,7 +42,7 @@ export const TITLE_REGEX_IN_MD = /{\s*title=["']?(.+)}\s*/; export const TITLE_REGEX_IN_MDX = /\s*title=["']?(.+)\s*/; const CALLOUT_COMPONENT = '$$$callout$$$'; // in md, we can not add import statement, so we use a special component name to avoid conflict with user components -const ERROR_PREFIX = '[remarkContainerSyntax]'; +// const ERROR_PREFIX = '[remarkContainerSyntax]'; export type DirectiveType = (typeof DIRECTIVE_TYPES)[number]; @@ -376,10 +376,11 @@ export const remarkContainerSyntax: Plugin<[], Root> = () => { return; } unknownTypes.add(type); - const supportedTypes = DIRECTIVE_TYPES.join(', '); - throw new Error( - `${ERROR_PREFIX} Unknown container directive type "${type}". Supported types: ${supportedTypes}`, - ); + // FIXME: add panic after remark-directive + // const supportedTypes = DIRECTIVE_TYPES.join(', '); + // logger.warn( + // `${ERROR_PREFIX} Unknown container directive type "${type}". Supported types: ${supportedTypes}`, + // ); }; return tree => {