From 5ddf9bd7ecb36e3ca1cf39c3ecff69bd3fad482e Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Fri, 27 Dec 2024 17:40:04 +0530 Subject: [PATCH] (feat:search) handle blockquotes in markdown --- extensions/react-widget/src/utils/helper.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extensions/react-widget/src/utils/helper.ts b/extensions/react-widget/src/utils/helper.ts index 13d2bf7a..ac257c91 100644 --- a/extensions/react-widget/src/utils/helper.ts +++ b/extensions/react-widget/src/utils/helper.ts @@ -86,6 +86,7 @@ export const processMarkdownString = (markdown: string, keyword?: string): Parse const headingMatch = trimmedLine.match(/^(#{1,6})\s+(.+)$/); const bulletMatch = trimmedLine.match(/^[-*]\s+(.+)$/); const numberedMatch = trimmedLine.match(/^\d+\.\s+(.+)$/); + const blockquoteMatch = trimmedLine.match(/^>+\s*(.+)$/); // Updated regex to handle multiple '>' symbols let content = trimmedLine; @@ -107,6 +108,12 @@ export const processMarkdownString = (markdown: string, keyword?: string): Parse content: content, tag: 'numberedList' }; + } else if (blockquoteMatch) { + content = blockquoteMatch[1]; + parsedElement = { + content: content, + tag: 'blockquote' + }; } else { parsedElement = { content: content,