mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
lecture parsing
This commit is contained in:
@@ -9,15 +9,14 @@ export function parseLecture(fileContent: string): Lecture {
|
|||||||
const name = extractLabelValue(settings, "Name");
|
const name = extractLabelValue(settings, "Name");
|
||||||
const date = extractLabelValue(settings, "Date");
|
const date = extractLabelValue(settings, "Date");
|
||||||
|
|
||||||
const content = fileContent.split("---\n")[1].trim();
|
const content = fileContent.split("---\n").slice(1).join("---\n").trim();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
date,
|
date,
|
||||||
content,
|
content,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error parsing lecture", fileContent);
|
console.error("Error parsing lecture: ", fileContent);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user