Skip to content

v0.2.1

Choose a tag to compare

@mmcky mmcky released this 06 Nov 22:59
· 42 commits to main since this release

v0.2.1 - Bug Fix Release

This is a bug fix release that resolves syntax highlighting issues with MyST code-cell directives that include YAML configuration blocks.

🐛 Bug Fixes

Fixed: Code-cell directives with configuration now receive proper syntax highlighting

Previously, code-cell directives with YAML configuration (:tags:, :linenos:, etc.) would not receive syntax highlighting. This was caused by the tree-sitter injection queries using exact string matching.

Before:

{code-cell} python
:tags: [output_scroll]
---
# This code was NOT highlighted ❌
import numpy as np

After:

{code-cell} python
:tags: [output_scroll]
---
# This code IS now highlighted ✅
import numpy as np

🔧 Technical Changes

  • Updated queries/markdown/injections.scm to use regex matching (#match?) instead of exact string matching (#eq?)
  • Patterns now match {code-cell} <language> regardless of additional configuration text
  • Supports both YAML block format (---) and concise format (:option: value)

✅ Testing

  • Added 21 new tests specifically for code-cell configuration support
  • All 76 tests passing
  • New test fixture: test/fixtures/code_cell_with_config.md
  • Visual test document: VISUAL_TEST.md for manual verification

📦 Installation

Update your plugin manager configuration to use v0.2.1:

lazy.nvim:

{
  "QuantEcon/myst-markdown-tree-sitter.nvim",
  version = "v0.2.1",
  config = function()
    require("myst-markdown").setup()
  end,
}

packer.nvim:

use {
  "QuantEcon/myst-markdown-tree-sitter.nvim",
  tag = "v0.2.1",
  config = function()
    require("myst-markdown").setup()
  end,
}

🙏 Credits

Thanks to the community for testing and reporting this issue!