fix(public-course): render exercise description as rich-text HTML (#920)

This commit is contained in:
Rotimi Best
2026-08-16 22:49:05 +01:00
committed by GitHub
parent 2ebb544a81
commit 1ffdd4bbae
2 changed files with 5 additions and 1 deletions
@@ -13,6 +13,7 @@
import { QuestionList } from '../exercise-question';
import { cn } from '../../tools';
import Callout from './callout.svelte';
import { SafeHtmlContent } from '../safe-html-content';
import type { PublicCourseCalloutAnimation, PublicCourseCalloutData, PublicExerciseViewData } from './types';
import type { PublicExerciseStoredAttempt } from './public-exercise-attempts-storage';
import {
@@ -401,7 +402,9 @@
</h1>
{#if exercise.description}
<p class="ui:mt-3 ui:text-muted-foreground">{exercise.description}</p>
<div class="prose ui:sm:prose-sm ui:mt-8 ui:max-w-none ui:dark:text-white">
<SafeHtmlContent content={exercise.description} />
</div>
{/if}
<div class="ui:mt-8 ui:space-y-6">
@@ -81,6 +81,7 @@ export interface PublicLessonViewData {
export interface PublicExerciseViewData {
kind: 'exercise';
title: string;
/** Rich-text HTML (as produced by the exercise description editor). */
description: string | null;
sectionTitle: string | null;
isUnlocked: boolean;