tagHandler - Handle blockquote, only with plain text

This commit is contained in:
2019-12-22 00:10:46 +05:30
parent da7ffae93c
commit aed9ea3d87
2 changed files with 15 additions and 0 deletions
+7
View File
@@ -155,3 +155,10 @@ test('should render link with only title', () => {
test('should render link without title and text', () => { test('should render link without title and text', () => {
expect((render(<a href="./test" />) as string).trim()).toBe('[](./test)'); expect((render(<a href="./test" />) as string).trim()).toBe('[](./test)');
}); });
test('should render blockquote with plain text', () => {
expect((render(<blockquote>some text</blockquote>) as string).trim()).toBe(
'> some text'
);
});
+8
View File
@@ -1,4 +1,5 @@
import { import {
blockquote,
emphasis, emphasis,
heading, heading,
image, image,
@@ -89,6 +90,13 @@ export default function handleTag(
} }
// END - Handle anchor tag (link) // END - Handle anchor tag (link)
// START - Handle blockquote
case 'blockquote': {
newParentASTNode = childASTNode = blockquote();
break;
}
// END - Handle blockquote
default: default:
newParentASTNode = parentASTNode; newParentASTNode = parentASTNode;
break; break;