6 lines
250 B
TypeScript
6 lines
250 B
TypeScript
export function extractQuote(content: string): { quote: string | null; body: string } {
|
|
const match = content.match(/^>\s*"(.+?)"\s*\n\n?([\s\S]*)$/);
|
|
if (match) return { quote: match[1], body: match[2] };
|
|
return { quote: null, body: content };
|
|
}
|