Skip to content

Fix adjacent Open question gaps rendering as one field#36

Open
pralad-p wants to merge 1 commit into
Yvee1:masterfrom
pralad-p:fix/open-question-adjacent-gaps
Open

Fix adjacent Open question gaps rendering as one field#36
pralad-p wants to merge 1 commit into
Yvee1:masterfrom
pralad-p:fix/open-question-adjacent-gaps

Conversation

@pralad-p

@pralad-p pralad-p commented Mar 15, 2026

Copy link
Copy Markdown

Summary

  • When multiple gap words are next to each other in an Open question (e.g. _word1_ _word2_), the spaces between them were being dropped during rendering
  • This made adjacent gaps appear as a single continuous input field, making it hard to tell them apart and fill them in correctly
  • Fixed by preserving whitespace-only pre-text between gaps in wrapStringWithPadding

Disclamer

I actually don't know a lot of Haskell (high exaggeration) so this was vibecoded, but just noticed this issue between adjacent _-padded (Open answers). Feel free to suggest another way to implement this, but just wanted to bring this to your attention. Love the app 🤗

When multiple gap words are next to each other (e.g. `_word1_ _word2_`),
the spaces between them were dropped, making them appear and behave as
one continuous input field. This was caused by `wrapStringWithPadding`
treating whitespace-only strings the same as empty strings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pralad-p pralad-p closed this Mar 15, 2026
@pralad-p
pralad-p deleted the fix/open-question-adjacent-gaps branch March 15, 2026 15:13
@Yvee1

Yvee1 commented Mar 15, 2026

Copy link
Copy Markdown
Owner

Thanks, I will have a look! Any reason you closed the PR?

@pralad-p
pralad-p restored the fix/open-question-adjacent-gaps branch March 15, 2026 20:59
@pralad-p pralad-p reopened this Mar 15, 2026
@pralad-p

Copy link
Copy Markdown
Author

Thanks @Yvee1, ah my bad, I saw the last commit of this project to be 2 years ago, so I assumed it wasn't being actively maintained. Reopened it now.

@pralad-p

Copy link
Copy Markdown
Author

Je kunt dit als testcase proberen:

# I am relieved that you are safe.
Ik ben _opgelucht_ dat je in _veiligheid_ _bent_.
---

Zonder deze patch wordt “veiligheid bent” als één woord geïnterpreteerd.

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