mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
Add unsupported text
This commit is contained in:
parent
5bbce45c56
commit
eba3a7bdcc
@ -242,3 +242,12 @@ test('markdownToHTML - Mixed formatting', () => {
|
||||
const output = markdownToHTML(input);
|
||||
expect(output).toEqual(expectedOutput);
|
||||
});
|
||||
|
||||
test('markdownToHTML - Unsupported formatting', () => {
|
||||
expect(
|
||||
markdownToHTML(`Hello
|
||||
- l1
|
||||
- l2
|
||||
- l3`)
|
||||
).toMatchInlineSnapshot('"<p>Hello</p>Unsupported markdown: list"');
|
||||
});
|
||||
|
@ -68,7 +68,7 @@ export function markdownToHTML(markdown: string): string {
|
||||
} else if (node.type === 'paragraph') {
|
||||
return `<p>${node.children.map(output).join('')}</p>`;
|
||||
}
|
||||
return '';
|
||||
return `Unsupported markdown: ${node.type}`;
|
||||
}
|
||||
|
||||
return children.map(output).join('');
|
||||
|
Loading…
x
Reference in New Issue
Block a user