mirror of
https://github.com/bendtherules/react-to-markdown.git
synced 2026-08-18 22:03:20 +00:00
tagHandler - Handle H6 + tests
This commit is contained in:
@@ -58,6 +58,10 @@ test('should render plain h5 with text', () => {
|
||||
expect((render(<h5>abcd</h5>) as string).trim()).toBe('##### abcd');
|
||||
});
|
||||
|
||||
test('should render plain h6 with text', () => {
|
||||
expect((render(<h6>abcd</h6>) as string).trim()).toBe('###### abcd');
|
||||
});
|
||||
|
||||
test('should render plain strong with text', () => {
|
||||
expect((render(<strong>abcd</strong>) as string).trim()).toBe('**abcd**');
|
||||
});
|
||||
@@ -110,24 +114,18 @@ test('should render image with alt text and title', () => {
|
||||
|
||||
test('should render image with only alt text', () => {
|
||||
expect(
|
||||
(render(
|
||||
<img src="./test.jpg" alt="some alt" />
|
||||
) as string).trim()
|
||||
(render(<img src="./test.jpg" alt="some alt" />) as string).trim()
|
||||
).toBe('');
|
||||
});
|
||||
|
||||
test('should render image with only title', () => {
|
||||
expect(
|
||||
(render(
|
||||
<img src="./test.jpg" title="some title" />
|
||||
) as string).trim()
|
||||
(render(<img src="./test.jpg" title="some title" />) as string).trim()
|
||||
).toBe('');
|
||||
});
|
||||
|
||||
test('should render image without attributes', () => {
|
||||
expect(
|
||||
(render(
|
||||
<img src="./test.jpg" />
|
||||
) as string).trim()
|
||||
).toBe('');
|
||||
expect((render(<img src="./test.jpg" />) as string).trim()).toBe(
|
||||
''
|
||||
);
|
||||
});
|
||||
|
||||
@@ -38,6 +38,9 @@ export default function handleTag(
|
||||
case 'h5':
|
||||
newParentASTNode = childASTNode = heading(5);
|
||||
break;
|
||||
case 'h6':
|
||||
newParentASTNode = childASTNode = heading(6);
|
||||
break;
|
||||
// END - Handle all headings
|
||||
|
||||
// START - Handle strong and em
|
||||
|
||||
Reference in New Issue
Block a user