Reflow quiz text to the terminal width instead of wrapping each YAML line #14

Merged
nessar merged 1 commits from fix-quiz-wrap into main 2026-10-27 19:15:42 +01:00
Owner

Quiz questions showed orphan words ("and", "every") alone on a line, and identifiers were split at their hyphens.

Cause. The question text is hard-wrapped in the YAML (about 105 columns). _wrap then wrapped each of those lines again, on its own, at min(terminal, 100).

Fix

  • awslings/quiz.py: a single newline is a space, blank lines stay paragraph breaks, no break at hyphens.
  • awslings/ui.py: width cap 100 → 120.
  • tests/test_quiz_cli.py: one test for the reflow, the paragraphs and the hyphen case.

Checked. No field of the bank (816 questions and explanations) has a list, a code block or a blank line, so reflowing everything is safe. All 408 questions render without error. Not run here: test_lab_templates_pass_cfn_lint (cfn-lint not installed in my throwaway environment).

🤖 Generated with Claude Code

Quiz questions showed orphan words ("and", "every") alone on a line, and identifiers were split at their hyphens. **Cause.** The question text is hard-wrapped in the YAML (about 105 columns). `_wrap` then wrapped each of those lines again, on its own, at `min(terminal, 100)`. **Fix** - `awslings/quiz.py`: a single newline is a space, blank lines stay paragraph breaks, no break at hyphens. - `awslings/ui.py`: width cap 100 → 120. - `tests/test_quiz_cli.py`: one test for the reflow, the paragraphs and the hyphen case. **Checked.** No field of the bank (816 questions and explanations) has a list, a code block or a blank line, so reflowing everything is safe. All 408 questions render without error. Not run here: `test_lab_templates_pass_cfn_lint` (cfn-lint not installed in my throwaway environment). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nessar added 1 commit 2026-10-27 19:15:30 +01:00
The question text is hard-wrapped in the YAML (about 105 columns) and was then
wrapped again line by line at min(terminal, 100), which left orphan words such
as "and" or "every" alone on a line, and split identifiers at their hyphens.
A single newline is now a space, blank lines stay paragraph breaks, and the
width cap is 120.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
nessar merged commit f68128891e into main 2026-10-27 19:15:42 +01:00
nessar deleted branch fix-quiz-wrap 2026-10-27 19:15:44 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessar/awslings#14