fix(public-course): render exercise description as rich-text HTML (#920)
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
import { QuestionList } from '../exercise-question';
|
import { QuestionList } from '../exercise-question';
|
||||||
import { cn } from '../../tools';
|
import { cn } from '../../tools';
|
||||||
import Callout from './callout.svelte';
|
import Callout from './callout.svelte';
|
||||||
|
import { SafeHtmlContent } from '../safe-html-content';
|
||||||
import type { PublicCourseCalloutAnimation, PublicCourseCalloutData, PublicExerciseViewData } from './types';
|
import type { PublicCourseCalloutAnimation, PublicCourseCalloutData, PublicExerciseViewData } from './types';
|
||||||
import type { PublicExerciseStoredAttempt } from './public-exercise-attempts-storage';
|
import type { PublicExerciseStoredAttempt } from './public-exercise-attempts-storage';
|
||||||
import {
|
import {
|
||||||
@@ -401,7 +402,9 @@
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
{#if exercise.description}
|
{#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}
|
{/if}
|
||||||
|
|
||||||
<div class="ui:mt-8 ui:space-y-6">
|
<div class="ui:mt-8 ui:space-y-6">
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ export interface PublicLessonViewData {
|
|||||||
export interface PublicExerciseViewData {
|
export interface PublicExerciseViewData {
|
||||||
kind: 'exercise';
|
kind: 'exercise';
|
||||||
title: string;
|
title: string;
|
||||||
|
/** Rich-text HTML (as produced by the exercise description editor). */
|
||||||
description: string | null;
|
description: string | null;
|
||||||
sectionTitle: string | null;
|
sectionTitle: string | null;
|
||||||
isUnlocked: boolean;
|
isUnlocked: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user