feat(store): accept CommonMark-valid task line variants#5
Merged
Conversation
The parser previously rejected hand-edited markdown that any other tool would accept: indented bullets, alternate markers (* or +), and tabs. Fixes: - Allow 0-3 leading spaces (CommonMark §5.2 indentation rule) - Allow a single leading tab (same rule, tab variant) - Accept `*` and `+` as bullet markers in addition to `-` Rejected (correctly, by spec): - 4+ leading spaces (code block, not list item) - `[]` empty checkbox brackets - `-[ ]` no space between marker and bracket - mid-line task syntax tsk's own writes still emit the canonical `- [ ]` form, so round-trips are unchanged. This only affects what we accept from humans. Tests: 7 new lenient inputs + 4 reject cases in TestParseLenient and TestParseRejectsNonTasks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The parser previously rejected hand-edited markdown that any other tool would accept: indented bullets, alternate markers (
*or+), and tabs.Fix
*and+as bullet markersStill rejected (correctly, per spec)
[]empty checkbox-[ ]missing separatorVerification
- [ ] hello- [ ] indented\t- [ ] tabbed* [ ] starred+ [ ] plussed- [ ] code block indent- [] no space insidetsk's own writes still emit the canonical
- [ ]form — no round-trip changes.Tests:
TestParseLenient(7 cases) +TestParseRejectsNonTasks(4 cases). All green with-race.Part 1/10 of the v0.3.0 improvement series.