mongodb-rag-core
Version:
Common elements used by MongoDB Chatbot Framework components.
18 lines (16 loc) • 584 B
TypeScript
/**
Extract the first H1 from a Markdown string
@param mdContent - some Markdown content
@returns page H1 `string` if it exists, otherwise `null`
@example
```ts
const mdContent = "# My Page Title";
const pageTitle = extractMarkdownH1(mdContent);
console.log(pageTitle); // "My Page Title"
const noTitleMdContent = "content without a h1";
const noTitle = extractMarkdownH1(noTitleMdContent);
console.log(noTitle); // null
```
*/
export declare function extractMarkdownH1(mdContent: string): string | undefined;
//# sourceMappingURL=extractMarkdownH1.d.ts.map