mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-18 00:14:38 +00:00
(feat:search) handle blockquotes in markdown
This commit is contained in:
1 parent
2420af3b6d
commit
5ddf9bd7ec
1 file changed
+7
@@ -86,6 +86,7 @@ export const processMarkdownString = (markdown: string, keyword?: string): Parse
|
|||||||
const headingMatch = trimmedLine.match(/^(#{1,6})\s+(.+)$/);
|
const headingMatch = trimmedLine.match(/^(#{1,6})\s+(.+)$/);
|
||||||
const bulletMatch = trimmedLine.match(/^[-*]\s+(.+)$/);
|
const bulletMatch = trimmedLine.match(/^[-*]\s+(.+)$/);
|
||||||
const numberedMatch = trimmedLine.match(/^\d+\.\s+(.+)$/);
|
const numberedMatch = trimmedLine.match(/^\d+\.\s+(.+)$/);
|
||||||
|
const blockquoteMatch = trimmedLine.match(/^>+\s*(.+)$/); // Updated regex to handle multiple '>' symbols
|
||||||
|
|
||||||
let content = trimmedLine;
|
let content = trimmedLine;
|
||||||
|
|
||||||
@@ -107,6 +108,12 @@ export const processMarkdownString = (markdown: string, keyword?: string): Parse
|
|||||||
content: content,
|
content: content,
|
||||||
tag: 'numberedList'
|
tag: 'numberedList'
|
||||||
};
|
};
|
||||||
|
} else if (blockquoteMatch) {
|
||||||
|
content = blockquoteMatch[1];
|
||||||
|
parsedElement = {
|
||||||
|
content: content,
|
||||||
|
tag: 'blockquote'
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
parsedElement = {
|
parsedElement = {
|
||||||
content: content,
|
content: content,
|
||||||
|
|||||||
Reference in new issue
Block a user