Skip to content

✨ Prefer markly for Markdown; stop forcing other Markdown backends - #70

Merged
pboling merged 2 commits into
mainfrom
fix/markdown-backend-markly-first
Sep 16, 2026
Merged

pboling merged 2 commits into
mainfrom
fix/markdown-backend-markly-first

Conversation

@pboling

@pboling pboling commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Why

  • Wrong :auto order: markdown-merge picked an unspecified (:auto) backend in BACKEND_REFERENCES order: kreuzberg-language-pack, then commonmarker, markly, kramdown. The language pack is always registered, so the native parsers never got a chance. In kettle-jem's bundle today, Markdown::Merge.resolve_backend(nil) returns "kreuzberg-language-pack". Markly is the best Markdown parser we have and should come first.
  • Forced dependencies: kettle-jem declared commonmarker-merge and kramdown-merge as runtime dependencies, although it loads only markdown/merge and ast/crispr/markdown/markly. Every gem that bundles kettle-jem therefore compiles commonmarker. That native extension does not build on ruby-head: magnus 0.8 is missing Ruby 4.1's handle_weak_references, and the fix sits unreleased on magnus main. kettle-jem-appraisals' ruby-head job has failed in setup this way since 2026-08-08.

What

  • markdown-merge
    • New BACKEND_PREFERENCE (markly, commonmarker, kramdown, kreuzberg-language-pack) drives :auto resolution. An explicit backend and TreeHaver.current_backend_id still win, and the language pack stays the final fallback.
    • Optional backend gems are still loaded only if installed (require … rescue LoadError), now markly first.
    • BACKEND_REFERENCES and available_markdown_backends keep their order, which the shared structuredmerge-fixtures slice-195 fixture defines for every language implementation.
  • kettle-jem
    • Drops the commonmarker-merge and kramdown-merge runtime dependencies. They are still used when a project installs them.
    • Removes both gems from the local sibling list in Gemfile, from gemfiles/modular/templating_local.gemfile, and from the templating_local.gemfile.example template.
    • Gemfile.lock was updated with bundle lock, using the env the committed lock is generated with. The diff only removes commonmarker-merge, kramdown-merge, commonmarker (all platforms) and rb_sys.

Verification

  • markdown-merge: full suite passes (46 examples, 0 failures). RuboCop Gradual passes once the ✨ kettle-jem: security floors from kettle-rb; drop dead appraisal helpers #69 Gemfile fix is present.
  • Runtime check in kettle-jem's bundle (loading ast/crispr/markdown/markly and markdown/merge): Markdown::Merge.resolve_backend(nil) was "kreuzberg-language-pack" before and is "markly" now. available_markdown_backends keeps its order.
  • kettle-jem full suite against this branch's sibling gems (STRUCTUREDMERGE_DEV pointing at the branch, K_JEM_TEMPLATING=true): 686 examples, 0 failures.
  • Unaffected cross-language fixture: the structuredmerge-fixtures slice-195 fixture still passes (fixtures_integration_spec).

🤖 Generated with Claude Code

https://claude.ai/code/session_01P8aveNcdgPobyMrq8DkD9r

pboling and others added 2 commits September 14, 2026 23:52
- markdown-merge: :auto resolves markly, commonmarker, kramdown, then
  kreuzberg-language-pack (last resort); optional backends load markly
  first. Reported available_markdown_backends order is unchanged.
- kettle-jem: drop commonmarker-merge and kramdown-merge runtime
  dependencies and local path entries; they remain usable when installed.
  Stops commonmarker's native build (fails on ruby-head) in every bundle
  that includes kettle-jem.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8aveNcdgPobyMrq8DkD9r
@pboling
pboling merged commit 4c31387 into main Sep 16, 2026
1 check passed
@pboling
pboling deleted the fix/markdown-backend-markly-first branch September 16, 2026 02:46
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.

1 participant