/**
 * Story packages author em-dashes as a double hyphen. Every surface that renders
 * package text converts on the way out; the raw `--` is what stays in the database,
 * because the same strings are persisted verbatim (`student_answers.selected_answer`)
 * and converted again independently by the PDF reports.
 *
 * Returns the HTML entity rather than the literal character: the quiz renders this
 * through `dangerouslySetInnerHTML`, alongside the `<br>` markup packages already carry.
 */
export const formatEmDashes = (text?: string | null): string =>
  (text ?? '').replace(/--/g, '&mdash;');
