Skip to content

fix: render LaTeX in quiz options#588

Merged
pancacake merged 1 commit into
HKUDS:devfrom
ZhouJ-sh:fix/587-quiz-option-latex
Jun 23, 2026
Merged

fix: render LaTeX in quiz options#588
pancacake merged 1 commit into
HKUDS:devfrom
ZhouJ-sh:fix/587-quiz-option-latex

Conversation

@ZhouJ-sh

Copy link
Copy Markdown
Contributor

Summary

  • render multiple-choice option labels with the existing MarkdownRenderer math pipeline
  • add a regression test that prevents option labels from falling back to raw text rendering

Fixes #587

Checks

  • npm run test:node
  • pre-commit run --all-files

@pancacake

Copy link
Copy Markdown
Collaborator

Merged into dev with a small fixup: the option label is wrapped in a <div> instead of a <span> so the block-level MarkdownRenderer output (<div><p>) stays valid inside the option <button> (avoids React's validateDOMNesting warning) and matches the four sibling MarkdownRenderer call sites in the file. The serif/prose option text is kept intentionally — it matches the question stem. Thanks!

@ZhouJ-sh
ZhouJ-sh deleted the fix/587-quiz-option-latex branch June 24, 2026 01:21
vaskoyudha added a commit to vaskoyudha/deeptutor-for-programmer-fork that referenced this pull request Jul 25, 2026
fix: render LaTeX in quiz multiple-choice options (HKUDS#587)

Routes option labels through MarkdownRenderer + KaTeX, matching the
question stem. Followed by a fixup that wraps the renderer in a <div>
(not a <span>) to keep the block-level renderer output valid inside the
option button.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants