Skip to content

Fix task-list visual alignment for spaced checkbox markers#109

Closed
dannyvink wants to merge 1 commit into
panphora:mainfrom
dannyvink:fix-checkbox-spacing-alignment
Closed

Fix task-list visual alignment for spaced checkbox markers#109
dannyvink wants to merge 1 commit into
panphora:mainfrom
dannyvink:fix-checkbox-spacing-alignment

Conversation

@dannyvink

@dannyvink dannyvink commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes a visual issue around checkboxes.

  1. The current version treats - [ ] (one space) and - [ ] (two spaces) differently, with the latter breaking the virtual overlay.
image

Changes

  • preserve user-entered spacing around markdown checkbox markers when rendering task list syntax (for example, - [ ])
  • parse empty checkbox lines as task items so the preview layer does not switch modes after the first typed content character

Test plan

  • Run npm test
  • Run npm run build
  • Verify parser expectations for - [ ] Task, - [ ] , and - [ ] Task

@dannyvink
dannyvink force-pushed the fix-checkbox-spacing-alignment branch from 01e8fb3 to 1ad78e8 Compare April 7, 2026 18:08
@dannyvink dannyvink changed the title Preserve checkbox spacing in parser and smart lists Fix task-list visual alignment for spaced checkbox markers Apr 7, 2026
panphora pushed a commit that referenced this pull request May 2, 2026
Markdown task list parsing only handled exactly one space around `[ ]`,
so `-  [ ] task` (two spaces) or empty `-  [ ] ` lines rendered with
normalized spacing that didn't match the textarea, breaking the overlay's
character-perfect alignment.

Update the regex to capture spacing before and after the checkbox
separately and re-emit it verbatim, and allow empty content so the
preview doesn't switch parsing modes the moment the user types the first
character.

Co-authored-by: Danny Vink <danny.vink@reddit.com>
@panphora

panphora commented May 2, 2026

Copy link
Copy Markdown
Owner

Merged in 82aad33 via cherry-pick (rebuilt dist/ locally rather than carrying it in the merge). Original commit and authorship by @dannyvink preserved.

Thanks for catching this — the alignment is fragile around whitespace and the regex change is the right surgical fix.

Will ship in the next release.

@panphora panphora closed this May 2, 2026
panphora added a commit that referenced this pull request May 2, 2026
Adds new entries for be5invis (#108), Danny Vink (#109), yurivish (#110),
phinnaeus (#110 diagnosis), and Tan Nhu (#111). Appends new reports to
existing entries for 1951FDG (#102) and nodesocket (#101).
@panphora

panphora commented May 2, 2026

Copy link
Copy Markdown
Owner

Shipped in v2.3.7 (commit 82aad33).

The regex in parseTaskList now captures spacing before and after [ ] separately and re-emits it verbatim, so - [ ] task (or any user-typed spacing) round-trips identically to the textarea — keeping the overlay character-aligned. Empty content is also allowed so the preview doesn't switch parsing modes the moment the first character is typed.

Thanks @dannyvink for the fix.

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