6 lines
167 B
TypeScript
6 lines
167 B
TypeScript
export function extractTitle(markdownContent: string): string | null {
|
|
return (
|
|
/^\s*#\s+(?<title>.+)[\n.]+/.exec(markdownContent)?.groups?.title ?? null
|
|
);
|
|
}
|