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

@@ -1,3 +1,5 @@
import MarkdownDisplay from "@/components/MarkdownDisplay";
import { SuspenseAndErrorHandling } from "@/components/SuspenseAndErrorHandling";
import { useLocalCourseSettingsQuery } from "@/hooks/localCourse/localCoursesHooks";
import { Lecture } from "@/models/local/lecture";
import { markdownToHTMLSafe } from "@/services/htmlMarkdownUtils";
@@ -8,15 +10,12 @@ export default function LecturePreview({ lecture }: { lecture: Lecture }) {
<>
<section className="border-b-slate-700 border-b-4">
<div className="text-center font-extrabold">{lecture.name}</div>
<div className="text-center font-bold text-slate-400">{lecture.date}</div>
<div className="text-center font-bold text-slate-400">
{lecture.date}
</div>
</section>
<section>
<div
className="markdownPreview "
dangerouslySetInnerHTML={{
__html: markdownToHTMLSafe(lecture.content, settings),
}}
></div>
<MarkdownDisplay markdown={lecture.content} />
</section>
</>
);