From aed9ea3d87de00e4bd17793f3b2c0912402f590c Mon Sep 17 00:00:00 2001 From: bendtherules Date: Sun, 22 Dec 2019 00:10:46 +0530 Subject: [PATCH] tagHandler - Handle blockquote, only with plain text --- __tests__/renderer-spec.tsx | 7 +++++++ src/tagHandler.ts | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/__tests__/renderer-spec.tsx b/__tests__/renderer-spec.tsx index 46cab12..1df83e1 100644 --- a/__tests__/renderer-spec.tsx +++ b/__tests__/renderer-spec.tsx @@ -155,3 +155,10 @@ test('should render link with only title', () => { test('should render link without title and text', () => { expect((render() as string).trim()).toBe('[](./test)'); }); + +test('should render blockquote with plain text', () => { + expect((render(
some text
) as string).trim()).toBe( + '> some text' + ); +}); + diff --git a/src/tagHandler.ts b/src/tagHandler.ts index 8e92d74..83c964c 100644 --- a/src/tagHandler.ts +++ b/src/tagHandler.ts @@ -1,4 +1,5 @@ import { + blockquote, emphasis, heading, image, @@ -89,6 +90,13 @@ export default function handleTag( } // END - Handle anchor tag (link) + // START - Handle blockquote + case 'blockquote': { + newParentASTNode = childASTNode = blockquote(); + break; + } + // END - Handle blockquote + default: newParentASTNode = parentASTNode; break;