tagHandler - Handle paragraph tag + basic test

This commit is contained in:
2019-12-22 00:14:28 +05:30
parent aed9ea3d87
commit 99ab98b3b9
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -6,6 +6,7 @@ import {
link,
list,
listItem,
paragraph,
strong,
} from 'mdast-builder';
import { AnchorHTMLAttributes, ImgHTMLAttributes } from 'react';
@@ -24,6 +25,13 @@ export default function handleTag(
let newParentASTNode: MDASTParent | undefined;
switch (tagType) {
// START - Handle paragraph
case 'p': {
newParentASTNode = childASTNode = paragraph();
break;
}
// END - Handle paragraph
// START - Handle all headings
case 'h1':
newParentASTNode = childASTNode = heading(1);