Skip to content

Commit 42fafc7

Browse files
committed
started work on commonmark+qmd-compatible subset. Fixed a backslash bug in our parser
1 parent 07b8a10 commit 42fafc7

25 files changed

Lines changed: 16060 additions & 81 deletions

.beads/issues.jsonl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{"id":"k-0dqu","title":"Refactor citeproc output rendering to unify String and Inlines paths","description":"The quarto-citeproc crate has dual code paths for Output AST conversion: render() -\u003e String and to_inlines() -\u003e Pandoc AST. Both implement similar logic for delimiter handling, punctuation collision avoidance, formatting, etc. This creates maintenance burden and potential for bugs (like the delimiter inheritance bug). Refactor to use Output -\u003e Inlines as the canonical conversion, then Inlines -\u003e String for the String path. Plan: claude-notes/plans/2025-12-05-citeproc-delimiter-inheritance-report.md","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-05T17:36:21.963061-06:00","updated_at":"2025-12-05T18:23:28.822793-06:00","closed_at":"2025-12-05T18:23:28.822793-06:00"}
2+
{"id":"k-0dqw","title":"Fix trailing LineBreak at end of block to match CommonMark","description":"In CommonMark, a backslash at the end of a block (paragraph, header) produces a literal backslash, not a LineBreak. pampa currently produces LineBreak in this case. The fix should convert trailing LineBreak to Str('\\\\') in the postprocess.rs handlers.\n\nPlan document: claude-notes/plans/2025-12-17-trailing-linebreak-fix.md","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-12-17T08:00:28.743309-06:00","updated_at":"2025-12-17T08:39:08.442844-06:00","closed_at":"2025-12-17T08:39:08.442844-06:00"}
23
{"id":"k-1","title":"Migrate quarto-markdown error handling to quarto-error-reporting","description":"Replace custom ErrorCollector with quarto-error-reporting infrastructure using phased bridge pattern. See claude-notes/plans/2025-10-18-error-reporting-migration.md for detailed plan.\n\nPhase A: Implement rendering (to_text, to_json, generic_error helper)\nPhase B: Create DiagnosticCollector bridge\nPhase C: Switch implementations\nPhase D: Source location integration (future)\nPhase E: Retire old collectors (future)\n\nFocus is infrastructure change, not message enhancement. Use Q-0-99 with file!() line!() for now.","status":"closed","priority":2,"issue_type":"epic","created_at":"2025-10-18T14:41:31.345695-05:00","updated_at":"2025-10-28T12:43:01.067279-05:00","closed_at":"2025-10-28T12:43:01.067279-05:00","dependencies":[{"issue_id":"k-1","depends_on_id":"k-5","type":"blocks","created_at":"2025-10-18T13:52:20.671231-05:00","created_by":"import"}]}
34
{"id":"k-10","title":"Run full test suite and verify migration","description":"Run cargo test for quarto-markdown-pandoc and ensure all tests pass after ErrorCollector to DiagnosticCollector migration","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-18T15:29:07.029816-05:00","updated_at":"2025-10-18T15:33:05.814566-05:00","closed_at":"2025-10-18T15:33:05.814566-05:00","dependencies":[{"issue_id":"k-10","depends_on_id":"k-9","type":"blocks","created_at":"2025-10-18T13:52:20.672035-05:00","created_by":"import"}]}
45
{"id":"k-100","title":"Collect all warnings in ParseResult.diagnostics","description":"Combine warnings from AST conversion (error_collector) and metadata parsing into ParseResult.diagnostics instead of outputting to stderr","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-21T09:25:31.72535-05:00","updated_at":"2025-10-21T10:29:21.892234-05:00","closed_at":"2025-10-21T10:29:21.892234-05:00","dependencies":[{"issue_id":"k-100","depends_on_id":"k-96","type":"discovered-from","created_at":"2025-10-21T09:25:31.727071-05:00","created_by":"cscheid"}]}
@@ -503,6 +504,8 @@
503504
{"id":"k-99","title":"Convert all error returns in qmd::read to DiagnosticMessage","description":"Update tree-sitter errors, deep nesting errors, manual parse errors, AST conversion errors to all return DiagnosticMessage","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-21T09:25:23.062813-05:00","updated_at":"2025-10-21T10:29:21.878964-05:00","closed_at":"2025-10-21T10:29:21.878964-05:00","dependencies":[{"issue_id":"k-99","depends_on_id":"k-96","type":"discovered-from","created_at":"2025-10-21T09:25:23.065118-05:00","created_by":"cscheid"}]}
504505
{"id":"k-dqce","title":"Phase 4: CLI integration for templates","description":"Add CLI options (--template, --template-bundle, --body-format), embed built-in templates, add export-template subcommand, update main.rs routing.","status":"in_progress","priority":1,"issue_type":"task","created_at":"2025-12-05T11:44:28.727559-06:00","updated_at":"2025-12-05T11:54:27.284787-06:00","dependencies":[{"issue_id":"k-dqce","depends_on_id":"k-y2f3","type":"blocks","created_at":"2025-12-05T11:44:28.729222-06:00","created_by":"cscheid"},{"issue_id":"k-dqce","depends_on_id":"k-5u7d","type":"blocks","created_at":"2025-12-05T11:45:03.917294-06:00","created_by":"cscheid"}]}
505506
{"id":"k-fgyv","title":"Design Python filter integration for quarto-markdown-pandoc","description":"Explore feasibility and design architecture for native Python filters that can run in-process, similar to Lua filters. Goals: (1) leverage existing Python interpreter or embed libpython, (2) build Python package with entry points to quarto-markdown-pandoc, (3) provide comparable dev experience to Lua filters with walk() methods and AST node constructors.\n\n**Plan document:** claude-notes/plans/2025-12-06-python-filter-integration.md","status":"open","priority":1,"issue_type":"feature","created_at":"2025-12-06T12:46:57.081157-06:00","updated_at":"2025-12-06T12:52:28.741554-06:00"}
507+
{"id":"k-g9uc","title":"Property testing framework for CommonMark subset validation","description":"Design and implement a property testing framework using proptest to verify that generated Pandoc ASTs roundtrip correctly through qmd writer → qmd reader and comrak parser. This provides stronger coverage than hand-written differential tests by generating arbitrary valid inputs.","notes":"See claude-notes/plans/2025-12-16-property-testing-commonmark-subset.md for full design.\n\nAPPROACH: Feature set-based generators that progressively add complexity.\n\nFEATURE SET DESIGN:\n- Generator takes a set of enabled features (InlineFeatures, BlockFeatures)\n- When using a feature (e.g., Emph), recurse with that feature removed\n- Elegantly prevents Emph-inside-Emph and naturally limits nesting depth\n- Enables progressive complexity testing\n\nINLINE PROGRESSION (L0-L7):\nL0: Plain text (Str, Space, SoftBreak)\nL1: + Emph\nL2: + Strong\nL3: + Code\nL4: + Link\nL5: + Image\nL6: + Autolink\nL7: + LineBreak\n\nBLOCK PROGRESSION (B0-B6):\nB0: Paragraph only\nB1: + Header\nB2: + CodeBlock\nB3: + HorizontalRule\nB4: + BlockQuote (recursive)\nB5: + BulletList (recursive)\nB6: + OrderedList\n\nIMPLEMENTATION: 7 phases with checkpoints after each level\n- Each phase adds features and verifies tests pass before proceeding\n- Progressive approach helps isolate which features cause failures\n\nNORMALIZATION:\n- Strip heading IDs\n- Figure → Paragraph(Image)\n- Strip autolink uri class\n- Strip extra code block attributes","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-16T16:46:33.219368-06:00","updated_at":"2025-12-16T16:59:48.737986-06:00","dependencies":[{"issue_id":"k-g9uc","depends_on_id":"k-333","type":"parent-child","created_at":"2025-12-16T16:46:33.221733-06:00","created_by":"daemon"}]}
508+
{"id":"k-igyi","title":"comrak-to-pandoc: Missing Space inline handling in conversion","description":"Property testing revealed that comrak-to-pandoc conversion produces different ASTs than pampa for input with whitespace before styled text. Comrak produces [Str(\"aA\"), Emph(...)] while pampa produces [Str(\"aA\"), Space, Emph(...)]. Need to investigate whether comrak's AST contains the space and we're losing it in conversion.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-12-16T17:16:40.1214-06:00","updated_at":"2025-12-16T17:27:03.039945-06:00","closed_at":"2025-12-16T17:27:03.039945-06:00","dependencies":[{"issue_id":"k-igyi","depends_on_id":"k-g9uc","type":"discovered-from","created_at":"2025-12-16T17:16:40.123882-06:00","created_by":"daemon"}]}
506509
{"id":"k-ke2m","title":"Filesystem synchronization design for quarto-hub","description":"Design the bidirectional synchronization between filesystem (.qmd files) and automerge documents.\n\n## Core Design: Unified Sync Algorithm\n\nA single fork-and-merge algorithm handles ALL sync scenarios (startup, shutdown, periodic, user-triggered):\n\n1. Fork doc at last sync checkpoint\n2. Apply filesystem content to fork via update_text (Myers diff)\n3. Merge fork back into main doc (CRDT merge)\n4. Write merged result to filesystem\n5. Update checkpoint\n\nThis naturally handles: no changes (no-op), automerge-only changes, filesystem-only changes, and true divergence (three-way merge).\n\n## Key Decisions\n- Automerge update_text handles diffing internally (grapheme-aware Myers)\n- Sync state stored locally in sync-state.json (not synced to peers)\n- Algorithm converges: after sync, fs and automerge match\n\n## Related Issues\n- k-r2t1 (filesystem serialization strategy)\n- k-yvfo (conflict resolution for divergence)\n\nDesign document: claude-notes/plans/2025-12-09-filesystem-sync-design.md","status":"open","priority":1,"issue_type":"task","created_at":"2025-12-09T15:56:36.732287-06:00","updated_at":"2025-12-09T16:53:24.323101-06:00","dependencies":[{"issue_id":"k-ke2m","depends_on_id":"k-4wex","type":"discovered-from","created_at":"2025-12-09T15:56:36.733851-06:00","created_by":"cscheid"}]}
507510
{"id":"k-kswp","title":"Phase 4: quarto-yaml integration","description":"Extend quarto-yaml tag parsing to recognize !prefer and !concat. Ensure tags flow through to YamlWithSourceInfo.tag field. Integrate error handling with DiagnosticCollector. Plan: claude-notes/plans/2025-12-07-config-merging-design.md Phase 4","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-07T14:03:57.230535-06:00","updated_at":"2025-12-07T14:32:45.993075-06:00","closed_at":"2025-12-07T14:32:45.993075-06:00","dependencies":[{"issue_id":"k-kswp","depends_on_id":"k-zvzm","type":"parent-child","created_at":"2025-12-07T14:03:57.232276-06:00","created_by":"cscheid"}]}
508511
{"id":"k-libc","title":"Automerge schema design for quarto-hub","description":"Design the automerge schema for: (1) the project index document mapping file paths to doc-ids, (2) individual .qmd document representation. Consider what data structures work well with CRDTs.","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-08T13:24:44.089038-06:00","updated_at":"2025-12-08T13:24:44.089038-06:00","dependencies":[{"issue_id":"k-libc","depends_on_id":"k-4wex","type":"related","created_at":"2025-12-08T13:24:44.091758-06:00","created_by":"cscheid"}]}

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
# Use bd merge for beads JSONL files
3+
.beads/issues.jsonl merge=beads

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ target
2020
!.beads/*.jsonl
2121

2222
external-sources/
23+
!external-sources/commonmark-spec/spec.txt

0 commit comments

Comments
 (0)