lecture parsing

This commit is contained in:
2024-11-08 11:52:38 -07:00
parent 95d758210c
commit 351bac3ebf

View File

@@ -9,15 +9,14 @@ export function parseLecture(fileContent: string): Lecture {
const name = extractLabelValue(settings, "Name");
const date = extractLabelValue(settings, "Date");
const content = fileContent.split("---\n")[1].trim();
const content = fileContent.split("---\n").slice(1).join("---\n").trim();
return {
name,
date,
content,
};
} catch (error) {
console.error("Error parsing lecture", fileContent);
console.error("Error parsing lecture: ", fileContent);
throw error;
}
}