freeCodeCamp / ui

freeCodeCamp's UI Component Library
BSD 3-Clause "New" or "Revised" License
14 stars 15 forks source link

[QuizQuestion] Render the label of answers as a div #330

Closed huyenltnguyen closed 1 week ago

huyenltnguyen commented 1 week ago

Description

The label of the answers should be rendered as a div instead of a p, otherwise there would be an a11y issue when the label contains PrismFormatted (which could render as a div).

Error when the label contains PrismFormatted Screenshot 2024-09-23 at 16 15 25

Changes needed

Remove as="p" from this line:

https://github.com/freeCodeCamp/ui/blob/6cc3039debdfdbfe0c88f2aab8187af6b23436c5/src/quiz-question/answer.tsx#L92