added catches around markdown to html, might throw exception if image error

This commit is contained in:
2025-01-31 09:14:16 -07:00
parent 777d1e4659
commit 54e071b053
9 changed files with 77 additions and 48 deletions

View File

@@ -104,15 +104,22 @@ export const getStatus = ({
),
};
const htmlIsSame = htmlIsCloseEnough(
markdownToHTMLSafe(assignment.description, settings),
canvasAssignment.description
);
if (!htmlIsSame)
try {
const htmlIsSame = htmlIsCloseEnough(
markdownToHTMLSafe(assignment.description, settings),
canvasAssignment.description
);
if (!htmlIsSame)
return {
status: "incomplete",
message: "Canvas description is different",
};
} catch (exception) {
return {
status: "incomplete",
message: "Canvas description is different",
message: "Error parsing markdown " + exception,
};
}
}
return { status: "published", message: "" };