Skip to content

feat(quiz): break an option's text where its author breaks the line - #497

Merged
vite-hub[bot] merged 3 commits into
mainfrom
feat/quiz-multiline-options
Nov 28, 2026
Merged

vite-hub[bot] merged 3 commits into
mainfrom
feat/quiz-multiline-options

Conversation

@onmax

@onmax onmax commented Nov 28, 2026

Copy link
Copy Markdown
Owner

An option written over two lines in a ::poll or ::question rendered as one run-on line, because Markdown joins a soft newline into a space. Social polls write options like "Neon\nserverless Postgres", and the break is part of how they read.

readOption now turns each newline in an option's own text into a <br>, inside inline marks too (**a\nb**), but not inside inline code. The key is still the hash of the text with whitespace collapsed, so every existing option keeps its key and stored answers still match. The revealed status line reads a break as a space.

Decisions:

  • A plain newline is a break in both blocks, as the plan says.
  • comark/quiz/line-break-option now fires only on a question's wrong option that has no > reason and runs onto a second line, which is where a missing > is likely. A multi-line option with a reason, or any poll option, is fine. Its doctor page says so.
  • A multi-line wrong option no longer gets the missing-rationale issue for its second line.

Checked:

  • packages/quiz/test/quiz.test.ts: <br> in a question option, a poll option and inside <strong>; the key of a two-line option equals the same option on one line; the keys of the existing question and poll fixtures are the same as on main (I hashed them with main's source).
  • Format, lint, typecheck of quiz, vite-doctor on the package, and the quiz doctor pages test.

Docs: a "Lines" section on the quiz page and a line in the comark-ui skill reference.

Plan: https://drop.vitehub.dev/d/wtn1zg3tajmt/social-poll-drop-plan

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-28T12:20:30.707940Z
We couldn’t complete this review. Comment @codex review to try again.
a4b0bd6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pkg-pr-new

pkg-pr-new Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@497

comark-badge

pnpm add https://pkg.pr.new/comark-badge@497

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@497

comark-cards

pnpm add https://pkg.pr.new/comark-cards@497

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@497

comark-cast

pnpm add https://pkg.pr.new/comark-cast@497

comark-charts

pnpm add https://pkg.pr.new/comark-charts@497

comark-chat

pnpm add https://pkg.pr.new/comark-chat@497

comark-chips

pnpm add https://pkg.pr.new/comark-chips@497

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@497

comark-code

pnpm add https://pkg.pr.new/comark-code@497

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@497

comark-colors

pnpm add https://pkg.pr.new/comark-colors@497

comark-comments

pnpm add https://pkg.pr.new/comark-comments@497

comark-critic

pnpm add https://pkg.pr.new/comark-critic@497

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@497

comark-details

pnpm add https://pkg.pr.new/comark-details@497

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@497

comark-diff

pnpm add https://pkg.pr.new/comark-diff@497

comark-embed

pnpm add https://pkg.pr.new/comark-embed@497

comark-fields

pnpm add https://pkg.pr.new/comark-fields@497

comark-figure

pnpm add https://pkg.pr.new/comark-figure@497

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@497

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@497

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@497

comark-github

pnpm add https://pkg.pr.new/comark-github@497

comark-icon

pnpm add https://pkg.pr.new/comark-icon@497

comark-include

pnpm add https://pkg.pr.new/comark-include@497

comark-keys

pnpm add https://pkg.pr.new/comark-keys@497

comark-links

pnpm add https://pkg.pr.new/comark-links@497

comark-linter

pnpm add https://pkg.pr.new/comark-linter@497

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@497

comark-mark

pnpm add https://pkg.pr.new/comark-mark@497

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@497

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@497

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@497

comark-media

pnpm add https://pkg.pr.new/comark-media@497

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@497

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@497

comark-motion

pnpm add https://pkg.pr.new/comark-motion@497

comark-outline

pnpm add https://pkg.pr.new/comark-outline@497

comark-properties

pnpm add https://pkg.pr.new/comark-properties@497

comark-qr

pnpm add https://pkg.pr.new/comark-qr@497

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@497

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@497

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@497

comark-sources

pnpm add https://pkg.pr.new/comark-sources@497

comark-steps

pnpm add https://pkg.pr.new/comark-steps@497

comark-table

pnpm add https://pkg.pr.new/comark-table@497

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@497

comark-tests

pnpm add https://pkg.pr.new/comark-tests@497

comark-time

pnpm add https://pkg.pr.new/comark-time@497

comark-ui

pnpm add https://pkg.pr.new/comark-ui@497

comark-xref

pnpm add https://pkg.pr.new/comark-xref@497

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@497

commit: 1cff1ba

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Restoring a revealed question while it is hidden can drop the correct answer from the screen-reader status. I reproduced this in Chromium with a closed disclosure.

Approach: Converting soft breaks in the option label after computing its key is the right place to preserve both the author's layout and existing answers.

Reviewed changes

  • Option rendering and keys: Verified that soft wraps render as <br> in questions and polls, including inside emphasis, and keep the same key when replacing a space.
  • Validation and docs: Checked when multiline options trigger a rationale warning and how that behavior is documented in the Doctor page and skill reference.
  • Answer reveal: Checked the screen-reader status in visible and collapsed questions. The quiz build and all 36 focused tests passed.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/quiz/src/script.ts Resolved
Comment thread packages/quiz/docs/index.md Resolved
@vite-hub

vite-hub Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Last seen running 2026-11-28T12:49:28.491Z 1s
View session Cancelled Not started —
View session Cancelled 2026-11-28T12:31:20.712Z 7m 40s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Pushed 1cff1ba and resolved the P1 review thread. Quiz announcements now exclude inline CSS, scripts, and tooltips while preserving line breaks as spaces, even inside closed disclosures. All 36 quiz tests passed, lint exited successfully, and both announcement cases passed in a DOM harness. The sandbox blocked local Chromium, so the new browser regression test awaits hosted CI.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The closed-disclosure fix works, but the new label reader can announce a component’s inline CSS and JavaScript instead of just the correct answer.

Reviewed changes

  • Reveal status: Verified that a multiline answer restored inside a closed <details> retains its text, and checked how the new DOM walk handles inline components.
  • Saved keys: Verified that replacing a space with a plain newline preserves the key, while Markdown hard breaks keep their distinct legacy key, as the updated docs now explain.
  • Tests: All 36 quiz parse/render tests and all 16 Chromium quiz tests passed.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/quiz/src/script.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. No P0 or P1 findings remain.

Reviewed changes

  • Answer announcements: Limited label extraction to revealed answers and excluded scripts, styles, hidden content, and tooltips without relying on layout.
  • Regression coverage: Added a Chromium test that verifies an inline :time announces only Correct answer: in 2 days. All 17 Chromium quiz tests and all 36 parser and HTML renderer tests passed, including answer restoration inside a closed disclosure.

Pullfrog  | View workflow run | Using gpt-6.2-sol(high) | 𝕏

@vite-hub
vite-hub Bot merged commit 3a56c3a into main Nov 28, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the feat/quiz-multiline-options branch November 28, 2026 13:08
@github-actions github-actions Bot mentioned this pull request Nov 28, 2026
@onmax

onmax commented Nov 28, 2026

Copy link
Copy Markdown
Owner Author

Before/after on Drop

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.

1 participant