Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions packages/core/src/node/mdx/remarkPlugins/containerSyntax.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(`
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/node/mdx/remarkPlugins/containerSyntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
/// <reference types="mdast-util-mdx-expression" />

import { logger } from '@rsbuild/core';
import type {
BlockContent,
Literal,
Expand Down Expand Up @@ -377,7 +378,7 @@ export const remarkContainerSyntax: Plugin<[], Root> = () => {
}
unknownTypes.add(type);
const supportedTypes = DIRECTIVE_TYPES.join(', ');
throw new Error(
logger.warn(
`${ERROR_PREFIX} Unknown container directive type "${type}". Supported types: ${supportedTypes}`,
);
};
Expand Down
Loading