Skip to content

Add underscore notation [_] for unchecked task list items#87

Merged
dereuromark merged 1 commit intomasterfrom
feature/underscore-task-notation
Mar 8, 2026
Merged

Add underscore notation [_] for unchecked task list items#87
dereuromark merged 1 commit intomasterfrom
feature/underscore-task-notation

Conversation

@dereuromark
Copy link
Contributor

Summary

The underscore notation is useful when:

  • Typing on mobile devices where spaces inside brackets can be difficult
  • Using editors without monospaced fonts where [ ] may look ambiguous
  • The underscore visually resembles an empty checkbox in source

Both notations are fully equivalent and can be mixed within the same list.

Changes

  • src/Node/Block/ListItem.php - Explicitly handle _ as unchecked marker (equivalent to space)
  • tests/official/task_lists.test - Add official test cases for underscore notation
  • tests/TestCase/DjotConverterTest.php - Add unit test
  • docs/syntax.md - Document the feature
  • docs/enhancements.md - Add to enhancements tracking

@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.85%. Comparing base (90010e5) to head (5c16296).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #87   +/-   ##
=========================================
  Coverage     93.85%   93.85%           
- Complexity     2133     2134    +1     
=========================================
  Files            77       77           
  Lines          5708     5708           
=========================================
  Hits           5357     5357           
  Misses          351      351           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Implements support for using underscore as an alternative to space
for unchecked task list items: `[_]` is now equivalent to `[ ]`.

This is useful for:
- Mobile devices where spaces inside brackets are hard to type
- Editors without monospaced fonts where `[ ]` may look ambiguous
- Visual clarity as underscore resembles an empty checkbox

Related to upstream discussion: jgm/djot#305
where jgm expressed support for this feature.

Changes:
- Update ListItem to explicitly handle underscore as unchecked marker
- Add official tests for underscore notation
- Add unit test in DjotConverterTest
- Update syntax.md and enhancements.md documentation
@dereuromark dereuromark force-pushed the feature/underscore-task-notation branch from 7589e81 to 5c16296 Compare March 8, 2026 05:53
@dereuromark dereuromark merged commit 68a5a74 into master Mar 8, 2026
6 checks passed
@dereuromark dereuromark deleted the feature/underscore-task-notation branch March 8, 2026 06:10
@dereuromark dereuromark added the enhancement New feature or request label Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant