Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package tree-sitter-markdown for
openSUSE:Factory checked in at 2026-03-13 21:18:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/tree-sitter-markdown (Old)
and /work/SRC/openSUSE:Factory/.tree-sitter-markdown.new.8177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "tree-sitter-markdown"
Fri Mar 13 21:18:01 2026 rev:7 rq:1338690 version:0.5.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/tree-sitter-markdown/tree-sitter-markdown.changes
2025-12-22 22:53:23.039270919 +0100
+++
/work/SRC/openSUSE:Factory/.tree-sitter-markdown.new.8177/tree-sitter-markdown.changes
2026-03-13 21:22:06.214457944 +0100
@@ -1,0 +2,12 @@
+Thu Mar 5 21:30:43 UTC 2026 - Björn Kettunen <[email protected]>
+
+- Remove redundant Neovim workaround
+
+-------------------------------------------------------------------
+Wed Jan 21 00:55:05 UTC 2026 - Richard Rahl <[email protected]>
+
+- Update to version 0.5.2:
+ * no changelog upstream, besides having a dependency of
+ tree-sitter >= 0.25.3
+
+-------------------------------------------------------------------
Old:
----
tree-sitter-markdown-0.5.1.tar.gz
New:
----
tree-sitter-markdown-0.5.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ tree-sitter-markdown.spec ++++++
--- /var/tmp/diff_new_pack.osK2Ek/_old 2026-03-13 21:22:06.690477669 +0100
+++ /var/tmp/diff_new_pack.osK2Ek/_new 2026-03-13 21:22:06.690477669 +0100
@@ -18,13 +18,13 @@
%define _name markdown
Name: tree-sitter-markdown
-Version: 0.5.1
+Version: 0.5.2
Release: 0
Summary: Markdown grammar for tree-sitter
License: MIT
URL: https://github.com/tree-sitter-grammars/tree-sitter-markdown
Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
-BuildRequires: tree-sitter
+BuildRequires: tree-sitter >= 0.25.3
%treesitter_grammars %{name} %{name}-inline
%description
@@ -40,17 +40,7 @@
%install
%treesitter_install
-#neovim stuff
-install -d %{buildroot}%{_libdir}/tree_sitter
-ln -s %{_libdir}/libtree-sitter-%{name}.so
%{buildroot}%{_libdir}/tree_sitter/%{_name}.so
-ln -s %{_libdir}/libtree-sitter-%{name}-inline.so
%{buildroot}%{_libdir}/tree_sitter/%{_name}_inline.so
-
%files
%license LICENSE
%treesitter_files
-%{_libdir}/tree_sitter/%{_name}.so
-%{_libdir}/tree_sitter/%{_name}_inline.so
-%if 0%{?suse_version} < 1600
-%dir %{_libdir}/tree_sitter
-%endif
++++++ tree-sitter-markdown-0.5.1.tar.gz -> tree-sitter-markdown-0.5.2.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/.gitattributes
new/tree-sitter-markdown-0.5.2/.gitattributes
--- old/tree-sitter-markdown-0.5.1/.gitattributes 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/.gitattributes 2026-01-11
11:44:35.000000000 +0100
@@ -8,7 +8,7 @@
*/src/tree_sitter/* linguist-generated
# C bindings
-*/bindings/c/* linguist-generated
+*/bindings/c/** linguist-generated
# Rust bindings
bindings/rust/build.rs linguist-generated
@@ -35,3 +35,7 @@
*/bindings/swift/** linguist-generated
Package.swift linguist-generated
Package.resolved linguist-generated
+
+# Zig bindings
+build.zig linguist-generated
+build.zig.zon linguist-generated
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/.github/dependabot.yml
new/tree-sitter-markdown-0.5.2/.github/dependabot.yml
--- old/tree-sitter-markdown-0.5.1/.github/dependabot.yml 1970-01-01
01:00:00.000000000 +0100
+++ new/tree-sitter-markdown-0.5.2/.github/dependabot.yml 2026-01-11
11:44:35.000000000 +0100
@@ -0,0 +1,16 @@
+version: 2
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "weekly"
+ cooldown:
+ default-days: 3
+ commit-message:
+ prefix: "ci"
+ labels:
+ - "CI"
+ groups:
+ actions:
+ patterns: ["*"]
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/.github/workflows/ci.yml
new/tree-sitter-markdown-0.5.2/.github/workflows/ci.yml
--- old/tree-sitter-markdown-0.5.1/.github/workflows/ci.yml 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/.github/workflows/ci.yml 2026-01-11
11:44:35.000000000 +0100
@@ -21,15 +21,13 @@
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout repository
- uses: actions/checkout@v5
+ uses: actions/checkout@v6
- name: Set up tree-sitter
- uses: tree-sitter/setup-action@v2
- with:
- install-lib: false
+ uses: tree-sitter/setup-action/cli@v2
- name: Set up Node.js
- uses: actions/setup-node@v4
+ uses: actions/setup-node@v6
with:
node-version: ${{vars.NODE_VERSION}}
@@ -58,7 +56,7 @@
parser: [tree-sitter-markdown, tree-sitter-markdown-inline]
steps:
- name: Checkout repository
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Check for scanner changes
@@ -74,3 +72,26 @@
if: steps.scanner-changes.outputs.changed == 'true'
with:
directory: ${{matrix.parser}}
+
+ query:
+ name: Validate queries
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ parser: [markdown, markdown-inline]
+ steps:
+ - name: Set up repository
+ uses: actions/checkout@v6
+
+ - name: Set up tree-sitter
+ uses: tree-sitter/setup-action/cli@v2
+
+ - name: Build parser
+ run: tree-sitter build tree-sitter-${{matrix.parser}}
+
+ - name: Set up ts_query_ls
+ run: curl -fL
https://github.com/ribru17/ts_query_ls/releases/latest/download/ts_query_ls-x86_64-unknown-linux-gnu.tar.gz
| tar -xz
+
+ - name: Check queries
+ run: ./ts_query_ls check -f tree-sitter-${{matrix.parser}}/queries/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/.github/workflows/release.yml
new/tree-sitter-markdown-0.5.2/.github/workflows/release.yml
--- old/tree-sitter-markdown-0.5.1/.github/workflows/release.yml
2025-09-16 19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/.github/workflows/release.yml
2026-01-11 11:44:35.000000000 +0100
@@ -17,5 +17,3 @@
jobs:
release:
uses: tree-sitter/workflows/.github/workflows/release.yml@main
- with:
- attestations: true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/.gitignore
new/tree-sitter-markdown-0.5.2/.gitignore
--- old/tree-sitter-markdown-0.5.1/.gitignore 2025-09-16 19:08:32.000000000
+0200
+++ new/tree-sitter-markdown-0.5.2/.gitignore 2026-01-11 11:44:35.000000000
+0100
@@ -1,18 +1,15 @@
# Rust artifacts
-Cargo.lock
target/
# Node artifacts
build/
prebuilds/
node_modules/
-*.tgz
# Swift artifacts
.build/
# Go artifacts
-go.sum
_obj/
# Python artifacts
@@ -28,6 +25,13 @@
*.dylib
*.dll
*.pc
+*.exp
+*.lib
+
+# Zig artifacts
+.zig-cache/
+zig-cache/
+zig-out/
# Example dirs
/examples/*/
@@ -37,7 +41,8 @@
*.obj
*.o
-# Moved bindings
-bindings/c/
-bindings/swift/TreeSitterMarkdown/
-bindings/swift/TreeSitterMarkdownInline/
+# Archives
+*.tar.gz
+*.tgz
+*.zip
+*.jar
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/.tsqueryrc.json
new/tree-sitter-markdown-0.5.2/.tsqueryrc.json
--- old/tree-sitter-markdown-0.5.1/.tsqueryrc.json 1970-01-01
01:00:00.000000000 +0100
+++ new/tree-sitter-markdown-0.5.2/.tsqueryrc.json 2026-01-11
11:44:35.000000000 +0100
@@ -0,0 +1,5 @@
+{
+ "$schema":
"https://raw.githubusercontent.com/ribru17/ts_query_ls/refs/heads/master/schemas/config.json",
+ "parser_install_directories": ["."],
+ "language_retrieval_patterns": ["tree-sitter-([^/]+)/queries/[^/]+\\.scm$"]
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/CMakeLists.txt
new/tree-sitter-markdown-0.5.2/CMakeLists.txt
--- old/tree-sitter-markdown-0.5.1/CMakeLists.txt 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/CMakeLists.txt 2026-01-11
11:44:35.000000000 +0100
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.13)
project(tree-sitter-markdown
- VERSION "0.5.1"
+ VERSION "0.5.2"
DESCRIPTION "Markdown grammar for tree-sitter"
HOMEPAGE_URL
"https://github.com/tree-sitter-grammars/tree-sitter-markdown"
LANGUAGES C)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/Cargo.toml
new/tree-sitter-markdown-0.5.2/Cargo.toml
--- old/tree-sitter-markdown-0.5.1/Cargo.toml 2025-09-16 19:08:32.000000000
+0200
+++ new/tree-sitter-markdown-0.5.2/Cargo.toml 2026-01-11 11:44:35.000000000
+0100
@@ -1,7 +1,7 @@
[package]
name = "tree-sitter-md"
description = "Markdown grammar for tree-sitter"
-version = "0.5.1"
+version = "0.5.2"
authors = ["MDeiml"]
license = "MIT"
readme = "README.md"
@@ -32,13 +32,13 @@
[dependencies]
tree-sitter-language = "0.1"
-tree-sitter = { version = "0.24", optional = true }
+tree-sitter = { version = "0.26", optional = true }
[dev-dependencies]
-tree-sitter = "0.24.3"
+tree-sitter = "0.26.3"
[build-dependencies]
-cc = "1.1.22"
+cc = "1.2"
[[bin]]
name = "benchmark"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/Package.swift
new/tree-sitter-markdown-0.5.2/Package.swift
--- old/tree-sitter-markdown-0.5.1/Package.swift 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/Package.swift 2026-01-11
11:44:35.000000000 +0100
@@ -8,7 +8,7 @@
.library(name: "TreeSitterMarkdown", targets: ["TreeSitterMarkdown",
"TreeSitterMarkdownInline"]),
],
dependencies: [
- .package(url: "https://github.com/ChimeHQ/SwiftTreeSitter", from:
"0.8.0"),
+ .package(name: "SwiftTreeSitter", url:
"https://github.com/tree-sitter/swift-tree-sitter", from: "0.8.0"),
],
targets: [
.target(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/bindings/go/binding_test.go
new/tree-sitter-markdown-0.5.2/bindings/go/binding_test.go
--- old/tree-sitter-markdown-0.5.1/bindings/go/binding_test.go 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/bindings/go/binding_test.go 1970-01-01
01:00:00.000000000 +0100
@@ -1,22 +0,0 @@
-package tree_sitter_markdown_test
-
-import (
- "testing"
-
- tree_sitter "github.com/tree-sitter/go-tree-sitter"
- tree_sitter_markdown
"github.com/tree-sitter-grammars/tree-sitter-markdown/bindings/go"
-)
-
-func TestCanLoadBlockGrammar(t *testing.T) {
- language := tree_sitter.NewLanguage(tree_sitter_markdown.Language())
- if language == nil {
- t.Errorf("Error loading Markdown block grammar")
- }
-}
-
-func TestCanLoadInlineGrammar(t *testing.T) {
- language :=
tree_sitter.NewLanguage(tree_sitter_markdown.InlineLanguage())
- if language == nil {
- t.Errorf("Error loading Markdown inline grammar")
- }
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/bindings/go/markdown.go
new/tree-sitter-markdown-0.5.2/bindings/go/markdown.go
--- old/tree-sitter-markdown-0.5.1/bindings/go/markdown.go 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/bindings/go/markdown.go 1970-01-01
01:00:00.000000000 +0100
@@ -1,14 +0,0 @@
-package tree_sitter_markdown
-
-// #cgo CPPFLAGS: -I../../tree-sitter-markdown
-// #cgo CFLAGS: -std=c11 -fPIC
-// #include "../../tree-sitter-markdown/src/parser.c"
-// #include "../../tree-sitter-markdown/src/scanner.c"
-import "C"
-
-import "unsafe"
-
-// Get the tree-sitter Language for the block grammar.
-func Language() unsafe.Pointer {
- return unsafe.Pointer(C.tree_sitter_markdown())
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/bindings/go/markdown_inline.go
new/tree-sitter-markdown-0.5.2/bindings/go/markdown_inline.go
--- old/tree-sitter-markdown-0.5.1/bindings/go/markdown_inline.go
2025-09-16 19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/bindings/go/markdown_inline.go
1970-01-01 01:00:00.000000000 +0100
@@ -1,14 +0,0 @@
-package tree_sitter_markdown
-
-// #cgo CPPFLAGS: -I../../tree-sitter-markdown-inline
-// #cgo CFLAGS: -std=c11 -fPIC
-// #include "../../tree-sitter-markdown-inline/src/parser.c"
-// #include "../../tree-sitter-markdown-inline/src/scanner.c"
-import "C"
-
-import "unsafe"
-
-// Get the tree-sitter Language for the inline grammar.
-func InlineLanguage() unsafe.Pointer {
- return unsafe.Pointer(C.tree_sitter_markdown_inline())
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/bindings/node/binding_test.js
new/tree-sitter-markdown-0.5.2/bindings/node/binding_test.js
--- old/tree-sitter-markdown-0.5.1/bindings/node/binding_test.js
2025-09-16 19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/bindings/node/binding_test.js
2026-01-11 11:44:35.000000000 +0100
@@ -1,16 +1,11 @@
-/// <reference types="node" />
+import assert from "node:assert";
+import { test } from "node:test";
+import Parser from "tree-sitter";
-const assert = require("node:assert");
-const { test } = require("node:test");
-
-const Parser = require("tree-sitter");
-
-test("can load block grammar", () => {
- const parser = new Parser();
- assert.doesNotThrow(() => parser.setLanguage(require(".")));
-});
-
-test("can load inline grammar", () => {
+test("can load grammar", () => {
const parser = new Parser();
- assert.doesNotThrow(() => parser.setLanguage(require(".").inline));
+ assert.doesNotReject(async () => {
+ const { default: language } = await import("./index.js");
+ parser.setLanguage(language);
+ });
});
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/bindings/node/index.d.ts
new/tree-sitter-markdown-0.5.2/bindings/node/index.d.ts
--- old/tree-sitter-markdown-0.5.1/bindings/node/index.d.ts 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/bindings/node/index.d.ts 2026-01-11
11:44:35.000000000 +0100
@@ -18,13 +18,43 @@
children: ChildNode[];
});
-type Language = {
- name: string;
+/**
+ * The tree-sitter language object for this grammar.
+ *
+ * @see {@linkcode
https://tree-sitter.github.io/node-tree-sitter/interfaces/Parser.Language.html
Parser.Language}
+ *
+ * @example
+ * import Parser from "tree-sitter";
+ * import Markdown from "tree-sitter-markdown";
+ *
+ * const parser = new Parser();
+ * parser.setLanguage(Markdown);
+ */
+declare const binding: {
+ /**
+ * The inner language object.
+ * @private
+ */
language: unknown;
+
+ /**
+ * The content of the `node-types.json` file for this grammar.
+ *
+ * @see {@linkplain
https://tree-sitter.github.io/tree-sitter/using-parsers/6-static-node-types
Static Node Types}
+ */
nodeTypeInfo: NodeInfo[];
-};
-declare const _exports: Language & {
- inline: Language
+ /** The syntax highlighting query for this grammar. */
+ HIGHLIGHTS_QUERY?: string;
+
+ /** The language injection query for this grammar. */
+ INJECTIONS_QUERY?: string;
+
+ /** The local variable query for this grammar. */
+ LOCALS_QUERY?: string;
+
+ /** The symbol tagging query for this grammar. */
+ TAGS_QUERY?: string;
};
-export = _exports;
+
+export default binding;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/bindings/node/index.js
new/tree-sitter-markdown-0.5.2/bindings/node/index.js
--- old/tree-sitter-markdown-0.5.1/bindings/node/index.js 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/bindings/node/index.js 2026-01-11
11:44:35.000000000 +0100
@@ -1,8 +1,37 @@
-const root = require("path").join(__dirname, "..", "..");
+import { readFileSync } from "node:fs";
+import { fileURLToPath } from "node:url";
-module.exports = require("node-gyp-build")(root);
+const root = fileURLToPath(new URL("../..", import.meta.url));
+
+const binding = typeof process.versions.bun === "string"
+ // Support `bun build --compile` by being statically analyzable enough to
find the .node file at build-time
+ ? await
import(`${root}/prebuilds/${process.platform}-${process.arch}/tree-sitter-markdown.node`)
+ : (await import("node-gyp-build")).default(root);
try {
- module.exports.nodeTypeInfo =
require("../../tree-sitter-markdown/src/node-types.json");
- module.exports.inline.nodeTypeInfo =
require("../../tree-sitter-markdown-inline/src/node-types.json");
-} catch (_) { }
+ const nodeTypes = await import(`${root}/src/node-types.json`, { with: {
type: "json" } });
+ binding.nodeTypeInfo = nodeTypes.default;
+} catch { }
+
+const queries = [
+ ["HIGHLIGHTS_QUERY", `${root}/tree-sitter-markdown/queries/highlights.scm`],
+ ["INJECTIONS_QUERY", `${root}/tree-sitter-markdown/queries/injections.scm`],
+ ["LOCALS_QUERY", `${root}/queries/locals.scm`],
+ ["TAGS_QUERY", `${root}/queries/tags.scm`],
+];
+
+for (const [prop, path] of queries) {
+ Object.defineProperty(binding, prop, {
+ configurable: true,
+ enumerable: true,
+ get() {
+ delete binding[prop];
+ try {
+ binding[prop] = readFileSync(path, "utf8");
+ } catch { }
+ return binding[prop];
+ }
+ });
+}
+
+export default binding;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/bindings/python/tests/test_binding.py
new/tree-sitter-markdown-0.5.2/bindings/python/tests/test_binding.py
--- old/tree-sitter-markdown-0.5.1/bindings/python/tests/test_binding.py
2025-09-16 19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/bindings/python/tests/test_binding.py
2026-01-11 11:44:35.000000000 +0100
@@ -6,12 +6,12 @@
class TestLanguage(TestCase):
def test_can_load_block_grammar(self):
try:
- tree_sitter.Language(tree_sitter_markdown.language())
+ Parser(Language(tree_sitter_markdown.language()))
except Exception:
self.fail("Error loading Markdown block grammar")
def test_can_load_block_grammar(self):
try:
- tree_sitter.Language(tree_sitter_markdown.inline_language())
+ Parser(Language(tree_sitter_markdown.inline_language())
except Exception:
self.fail("Error loading Markdown inline grammar")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/bindings/python/tree_sitter_markdown/__init__.py
new/tree-sitter-markdown-0.5.2/bindings/python/tree_sitter_markdown/__init__.py
---
old/tree-sitter-markdown-0.5.1/bindings/python/tree_sitter_markdown/__init__.py
2025-09-16 19:08:32.000000000 +0200
+++
new/tree-sitter-markdown-0.5.2/bindings/python/tree_sitter_markdown/__init__.py
2026-01-11 11:44:35.000000000 +0100
@@ -1,5 +1,43 @@
-"Markdown grammar for tree-sitter"
+"""Markdown grammar for tree-sitter"""
-from ._binding import language, inline_language
+from importlib.resources import files as _files
-__all__ = ["language", "inline_language"]
+from ._binding import language
+
+
+def _get_query(name, file):
+ try:
+ query = _files(f"{__package__}") / file
+ globals()[name] = query.read_text()
+ except FileNotFoundError:
+ globals()[name] = None
+ return globals()[name]
+
+
+def __getattr__(name):
+ if name == "HIGHLIGHTS_QUERY":
+ return _get_query("HIGHLIGHTS_QUERY",
"tree-sitter-markdown/queries/highlights.scm")
+ if name == "INJECTIONS_QUERY":
+ return _get_query("INJECTIONS_QUERY",
"tree-sitter-markdown/queries/injections.scm")
+ if name == "LOCALS_QUERY":
+ return _get_query("LOCALS_QUERY", "queries/locals.scm")
+ if name == "TAGS_QUERY":
+ return _get_query("TAGS_QUERY", "queries/tags.scm")
+
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
+
+
+__all__ = [
+ "language",
+ "HIGHLIGHTS_QUERY",
+ "INJECTIONS_QUERY",
+ "LOCALS_QUERY",
+ "TAGS_QUERY",
+]
+
+
+def __dir__():
+ return sorted(__all__ + [
+ "__all__", "__builtins__", "__cached__", "__doc__", "__file__",
+ "__loader__", "__name__", "__package__", "__path__", "__spec__",
+ ])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/bindings/python/tree_sitter_markdown/__init__.pyi
new/tree-sitter-markdown-0.5.2/bindings/python/tree_sitter_markdown/__init__.pyi
---
old/tree-sitter-markdown-0.5.1/bindings/python/tree_sitter_markdown/__init__.pyi
2025-09-16 19:08:32.000000000 +0200
+++
new/tree-sitter-markdown-0.5.2/bindings/python/tree_sitter_markdown/__init__.pyi
2026-01-11 11:44:35.000000000 +0100
@@ -1,3 +1,3 @@
-def language() -> object: ...
+def language() -> CapsuleType: ...
-def inline_language() -> object: ...
+def inline_language() -> CapsuleType: ...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/bindings/python/tree_sitter_markdown/binding.c
new/tree-sitter-markdown-0.5.2/bindings/python/tree_sitter_markdown/binding.c
---
old/tree-sitter-markdown-0.5.1/bindings/python/tree_sitter_markdown/binding.c
2025-09-16 19:08:32.000000000 +0200
+++
new/tree-sitter-markdown-0.5.2/bindings/python/tree_sitter_markdown/binding.c
2026-01-11 11:44:35.000000000 +0100
@@ -14,6 +14,13 @@
return PyCapsule_New(tree_sitter_markdown_inline(),
"tree_sitter.Language", NULL);
}
+static struct PyModuleDef_Slot slots[] = {
+#ifdef Py_GIL_DISABLED
+ {Py_mod_gil, Py_MOD_GIL_NOT_USED},
+#endif
+ {0, NULL}
+};
+
static PyMethodDef methods[] = {
{"language", _binding_language, METH_NOARGS,
"Get the tree-sitter language for the block grammar."},
@@ -26,10 +33,11 @@
.m_base = PyModuleDef_HEAD_INIT,
.m_name = "_binding",
.m_doc = NULL,
- .m_size = -1,
- .m_methods = methods
+ .m_size = 0,
+ .m_methods = methods,
+ .m_slots = slots,
};
PyMODINIT_FUNC PyInit__binding(void) {
- return PyModule_Create(&module);
+ return PyModuleDef_Init(&module);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/bindings/rust/build.rs
new/tree-sitter-markdown-0.5.2/bindings/rust/build.rs
--- old/tree-sitter-markdown-0.5.1/bindings/rust/build.rs 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/bindings/rust/build.rs 2026-01-11
11:44:35.000000000 +0100
@@ -8,6 +8,24 @@
#[cfg(target_env = "msvc")]
c_config.flag("-utf-8");
+ if std::env::var("TARGET").unwrap() == "wasm32-unknown-unknown" {
+ let Ok(wasm_headers) =
std::env::var("DEP_TREE_SITTER_LANGUAGE_WASM_HEADERS") else {
+ panic!("Environment variable DEP_TREE_SITTER_LANGUAGE_WASM_HEADERS
must be set by the language crate");
+ };
+ let Ok(wasm_src) =
+
std::env::var("DEP_TREE_SITTER_LANGUAGE_WASM_SRC").map(std::path::PathBuf::from)
+ else {
+ panic!("Environment variable DEP_TREE_SITTER_LANGUAGE_WASM_SRC
must be set by the language crate");
+ };
+
+ c_config.include(&wasm_headers);
+ c_config.files([
+ wasm_src.join("stdio.c"),
+ wasm_src.join("stdlib.c"),
+ wasm_src.join("string.c"),
+ ]);
+ }
+
for path in &[
block_dir.join("parser.c"),
block_dir.join("scanner.c"),
@@ -19,4 +37,25 @@
}
c_config.compile("tree-sitter-markdown");
+
+ println!("cargo:rustc-check-cfg=cfg(with_highlights_query)");
+ if !"tree-sitter-markdown/queries/highlights.scm".is_empty()
+ &&
std::path::Path::new("tree-sitter-markdown/queries/highlights.scm").exists()
+ {
+ println!("cargo:rustc-cfg=with_highlights_query");
+ }
+ println!("cargo:rustc-check-cfg=cfg(with_injections_query)");
+ if !"tree-sitter-markdown/queries/injections.scm".is_empty()
+ &&
std::path::Path::new("tree-sitter-markdown/queries/injections.scm").exists()
+ {
+ println!("cargo:rustc-cfg=with_injections_query");
+ }
+ println!("cargo:rustc-check-cfg=cfg(with_locals_query)");
+ if !"queries/locals.scm".is_empty() &&
std::path::Path::new("queries/locals.scm").exists() {
+ println!("cargo:rustc-cfg=with_locals_query");
+ }
+ println!("cargo:rustc-check-cfg=cfg(with_tags_query)");
+ if !"queries/tags.scm".is_empty() &&
std::path::Path::new("queries/tags.scm").exists() {
+ println!("cargo:rustc-cfg=with_tags_query");
+ }
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/bindings/rust/parser.rs
new/tree-sitter-markdown-0.5.2/bindings/rust/parser.rs
--- old/tree-sitter-markdown-0.5.1/bindings/rust/parser.rs 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/bindings/rust/parser.rs 2026-01-11
11:44:35.000000000 +0100
@@ -1,7 +1,9 @@
use std::collections::HashMap;
use std::num::NonZeroU16;
-use tree_sitter::{InputEdit, Language, Node, Parser, Point, Range, Tree,
TreeCursor};
+use tree_sitter::{
+ InputEdit, Language, Node, ParseOptions, Parser, Point, Range, Tree,
TreeCursor,
+};
use crate::{INLINE_LANGUAGE, LANGUAGE};
@@ -16,7 +18,7 @@
/// A stateful object for walking a [`MarkdownTree`] efficiently.
///
-/// This exposes the same methdos as [`TreeCursor`], but abstracts away the
+/// This exposes the same methods as [`TreeCursor`], but abstracts away the
/// double block / inline structure of [`MarkdownTree`].
pub struct MarkdownCursor<'a> {
markdown_tree: &'a MarkdownTree,
@@ -33,7 +35,7 @@
}
}
- /// Returns `true` if the current node is from the (inline
language)[INLINE_LANGUAGE]
+ /// Returns `true` if the current node is from the
[INLINE_LANGUAGE](inline language)
///
/// This information is needed to handle "tree-sitter internal" data like
/// [`field_id`](Self::field_id) correctly.
@@ -221,7 +223,7 @@
}
/// Create a new [`MarkdownCursor`] starting from the root of the tree.
- pub fn walk(&self) -> MarkdownCursor {
+ pub fn walk(&self) -> MarkdownCursor<'_> {
MarkdownCursor {
markdown_tree: self,
block_cursor: self.block_tree.walk(),
@@ -230,6 +232,28 @@
}
}
+/// The options used while parsing a [`MarkdownTree`].
+///
+/// This abstracts away the double block / inline structure of
[`MarkdownParser`].
+#[derive(Default)]
+pub struct MarkdownParseOptions<'a> {
+ block_options: Option<ParseOptions<'a>>,
+ inline_options: Option<ParseOptions<'a>>,
+}
+
+impl<'a> MarkdownParseOptions<'a> {
+ /// Creates a new [MarkdownParseOptions] instance.
+ pub fn new(
+ block_options: Option<ParseOptions<'a>>,
+ inline_options: Option<ParseOptions<'a>>,
+ ) -> Self {
+ MarkdownParseOptions {
+ block_options,
+ inline_options,
+ }
+ }
+}
+
impl Default for MarkdownParser {
fn default() -> Self {
let block_language = LANGUAGE.into();
@@ -252,14 +276,17 @@
/// If the text of the document has changed since `old_tree` was
/// created, then you must edit `old_tree` to match the new text using
/// [MarkdownTree::edit].
+ /// * `options` The [options][MarkdownParseOptions] used for parsing.
+ /// Use `MarkdownParseOptions::default()` if you don't need to pass any
options.
///
/// Returns a [MarkdownTree] if parsing succeeded, or `None` if:
/// * The timeout set with [tree_sitter::Parser::set_timeout_micros]
expired
/// * The cancellation flag set with
[tree_sitter::Parser::set_cancellation_flag] was flipped
- pub fn parse_with<T: AsRef<[u8]>, F: FnMut(usize, Point) -> T>(
+ pub fn parse_with_options<T: AsRef<[u8]>, F: FnMut(usize, Point) -> T>(
&mut self,
callback: &mut F,
old_tree: Option<&MarkdownTree>,
+ mut options: MarkdownParseOptions<'_>,
) -> Option<MarkdownTree> {
let MarkdownParser {
parser,
@@ -272,7 +299,11 @@
parser
.set_language(block_language)
.expect("Could not load block grammar");
- let block_tree = parser.parse_with(callback, old_tree.map(|tree|
&tree.block_tree))?;
+ let block_tree = parser.parse_with_options(
+ callback,
+ old_tree.map(|tree| &tree.block_tree),
+ options.block_options.as_mut().map(|b_opt| b_opt.reborrow()),
+ )?;
let (mut inline_trees, mut inline_indices) = if let Some(old_tree) =
old_tree {
let len = old_tree.inline_trees.len();
(Vec::with_capacity(len), HashMap::with_capacity(len))
@@ -322,9 +353,13 @@
}
ranges.push(range);
parser.set_included_ranges(&ranges).ok()?;
- let inline_tree = parser.parse_with(
+ let inline_tree = parser.parse_with_options(
callback,
old_tree.and_then(|old_tree| old_tree.inline_trees.get(i)),
+ options
+ .inline_options
+ .as_mut()
+ .map(|b_opt| b_opt.reborrow()),
)?;
inline_trees.push(inline_tree);
inline_indices.insert(node.id(), i);
@@ -353,7 +388,11 @@
/// * The timeout set with [tree_sitter::Parser::set_timeout_micros]
expired
/// * The cancellation flag set with
[tree_sitter::Parser::set_cancellation_flag] was flipped
pub fn parse(&mut self, text: &[u8], old_tree: Option<&MarkdownTree>) ->
Option<MarkdownTree> {
- self.parse_with(&mut |byte, _| &text[byte..], old_tree)
+ self.parse_with_options(
+ &mut |byte, _| &text[byte..],
+ old_tree,
+ MarkdownParseOptions::default(),
+ )
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/common/common.mak
new/tree-sitter-markdown-0.5.2/common/common.mak
--- old/tree-sitter-markdown-0.5.1/common/common.mak 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/common/common.mak 2026-01-11
11:44:35.000000000 +0100
@@ -1,9 +1,5 @@
-ifeq ($(OS),Windows_NT)
-$(error Windows is not supported)
-endif
-
HOMEPAGE_URL := https://github.com/tree-sitter-grammars/tree-sitter-markdown
-VERSION := 0.5.1
+VERSION := 0.5.2
# repository
SRC_DIR := src
@@ -12,8 +8,10 @@
# install directory layout
PREFIX ?= /usr/local
+DATADIR ?= $(PREFIX)/share
INCLUDEDIR ?= $(PREFIX)/include
LIBDIR ?= $(PREFIX)/lib
+BINDIR ?= $(PREFIX)/bin
PCLIBDIR ?= $(LIBDIR)/pkgconfig
# source/object files
@@ -30,21 +28,25 @@
SONAME_MINOR = $(word 1,$(subst ., ,$(VERSION)))
# OS-specific bits
-ifeq ($(shell uname),Darwin)
+MACHINE := $(shell $(CC) -dumpmachine)
+
+ifneq ($(findstring darwin,$(MACHINE)),)
SOEXT = dylib
SOEXTVER_MAJOR = $(SONAME_MAJOR).$(SOEXT)
SOEXTVER = $(SONAME_MAJOR).$(SONAME_MINOR).$(SOEXT)
LINKSHARED = -dynamiclib
-Wl,-install_name,$(LIBDIR)/lib$(LANGUAGE_NAME).$(SOEXTVER),-rpath,@executable_path/../Frameworks
+else ifneq ($(findstring mingw32,$(MACHINE)),)
+ SOEXT = dll
+ LINKSHARED += -s -shared -Wl,--out-implib,lib$(LANGUAGE_NAME).dll.a
else
SOEXT = so
SOEXTVER_MAJOR = $(SOEXT).$(SONAME_MAJOR)
SOEXTVER = $(SOEXT).$(SONAME_MAJOR).$(SONAME_MINOR)
LINKSHARED = -shared -Wl,-soname,lib$(LANGUAGE_NAME).$(SOEXTVER)
-endif
ifneq ($(filter $(shell uname),FreeBSD NetBSD DragonFly),)
PCLIBDIR := $(PREFIX)/libdata/pkgconfig
endif
-
+endif
all: lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) $(LANGUAGE_NAME).pc
@@ -57,25 +59,42 @@
$(STRIP) $@
endif
+ifneq ($(findstring mingw32,$(MACHINE)),)
+lib$(LANGUAGE_NAME).dll.a: lib$(LANGUAGE_NAME).$(SOEXT)
+endif
+
$(LANGUAGE_NAME).pc: bindings/c/$(LANGUAGE_NAME).pc.in
- sed -e 's|@CMAKE_PROJECT_VERSION@|$(VERSION)|' \
+ sed -e 's|@PROJECT_VERSION@|$(VERSION)|' \
-e 's|@CMAKE_INSTALL_LIBDIR@|$(LIBDIR:$(PREFIX)/%=%)|' \
-e 's|@CMAKE_INSTALL_INCLUDEDIR@|$(INCLUDEDIR:$(PREFIX)/%=%)|' \
-e 's|@PROJECT_DESCRIPTION@|$(DESCRIPTION)|' \
- -e 's|@CMAKE_PROJECT_HOMEPAGE_URL@|$(HOMEPAGE_URL)|' \
- -e 's|@CMAKE_INSTALL_PREFIX@|$(PREFIX)|' \
- -e 's|@TS_REQUIRES@|$(REQUIRES)|' $< > $@
+ -e 's|@PROJECT_HOMEPAGE_URL@|$(HOMEPAGE_URL)|' \
+ -e 's|@CMAKE_INSTALL_PREFIX@|$(PREFIX)|' $< > $@
+
+$(SRC_DIR)/grammar.json: grammar.js
+ $(TS) generate --no-parser $^
-$(PARSER): $(SRC_DIR)/grammar.js
+$(PARSER): $(SRC_DIR)/grammar.json
$(TS) generate $^
install: all
- install -Dm644 bindings/c/$(LANGUAGE_NAME).h
'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h
- install -Dm644 $(LANGUAGE_NAME).pc
'$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc
- install -Dm755 lib$(LANGUAGE_NAME).a
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a
+ install -d '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/$(LANGUAGE_NAME)
'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter '$(DESTDIR)$(PCLIBDIR)'
'$(DESTDIR)$(LIBDIR)'
+ install -m644 bindings/c/tree_sitter/$(LANGUAGE_NAME).h
'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h
+ install -m644 $(LANGUAGE_NAME).pc
'$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc
+ install -m644 lib$(LANGUAGE_NAME).a
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a
+ install -m755 lib$(LANGUAGE_NAME).$(SOEXT)
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER)
+ifneq ($(findstring mingw32,$(MACHINE)),)
+ install -d '$(DESTDIR)$(BINDIR)'
+ install -m755 lib$(LANGUAGE_NAME).dll
'$(DESTDIR)$(BINDIR)'/lib$(LANGUAGE_NAME).dll
+ install -m755 lib$(LANGUAGE_NAME).dll.a
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).dll.a
+else
install -m755 lib$(LANGUAGE_NAME).$(SOEXT)
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER)
- ln -sf lib$(LANGUAGE_NAME).$(SOEXTVER)
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR)
- ln -sf lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR)
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT)
+ cd '$(DESTDIR)$(LIBDIR)' && ln -sf lib$(LANGUAGE_NAME).$(SOEXTVER)
lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR)
+ cd '$(DESTDIR)$(LIBDIR)' && ln -sf
lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) lib$(LANGUAGE_NAME).$(SOEXT)
+endif
+ifneq ($(wildcard queries/*.scm),)
+ install -m644 queries/*.scm
'$(DESTDIR)$(DATADIR)'/tree-sitter/queries/$(LANGUAGE_NAME)
+endif
uninstall:
$(RM) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a \
@@ -84,9 +103,10 @@
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT) \
'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h \
'$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc
+ $(RM) -r '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/$(LANGUAGE_NAME)
clean:
- $(RM) $(OBJS) $(LANGUAGE_NAME).pc lib$(LANGUAGE_NAME).a
lib$(LANGUAGE_NAME).$(SOEXT)
+ $(RM) $(OBJS) $(LANGUAGE_NAME).pc lib$(LANGUAGE_NAME).a
lib$(LANGUAGE_NAME).$(SOEXT) lib$(LANGUAGE_NAME).dll.a
test:
$(TS) test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/go.mod
new/tree-sitter-markdown-0.5.2/go.mod
--- old/tree-sitter-markdown-0.5.1/go.mod 2025-09-16 19:08:32.000000000
+0200
+++ new/tree-sitter-markdown-0.5.2/go.mod 1970-01-01 01:00:00.000000000
+0100
@@ -1,9 +0,0 @@
-module github.com/tree-sitter-grammars/tree-sitter-markdown
-
-go 1.23
-
-toolchain go1.23.0
-
-require github.com/tree-sitter/go-tree-sitter v0.23.1
-
-require github.com/mattn/go-pointer v0.0.1 // indirect
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/package-lock.json
new/tree-sitter-markdown-0.5.2/package-lock.json
--- old/tree-sitter-markdown-0.5.1/package-lock.json 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/package-lock.json 2026-01-11
11:44:35.000000000 +0100
@@ -1,12 +1,12 @@
{
"name": "@tree-sitter-grammars/tree-sitter-markdown",
- "version": "0.5.1",
+ "version": "0.5.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@tree-sitter-grammars/tree-sitter-markdown",
- "version": "0.5.1",
+ "version": "0.5.2",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
@@ -302,10 +302,11 @@
}
},
"node_modules/tar-fs": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
- "integrity":
"sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz",
+ "integrity":
"sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/package.json
new/tree-sitter-markdown-0.5.2/package.json
--- old/tree-sitter-markdown-0.5.1/package.json 2025-09-16 19:08:32.000000000
+0200
+++ new/tree-sitter-markdown-0.5.2/package.json 2026-01-11 11:44:35.000000000
+0100
@@ -1,6 +1,6 @@
{
"name": "@tree-sitter-grammars/tree-sitter-markdown",
- "version": "0.5.1",
+ "version": "0.5.2",
"description": "Markdown grammar for tree-sitter",
"repository": "github:tree-sitter-grammars/tree-sitter-markdown",
"license": "MIT",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/pyproject.toml
new/tree-sitter-markdown-0.5.2/pyproject.toml
--- old/tree-sitter-markdown-0.5.1/pyproject.toml 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/pyproject.toml 2026-01-11
11:44:35.000000000 +0100
@@ -5,7 +5,7 @@
[project]
name = "tree-sitter-markdown"
description = "Markdown grammar for tree-sitter"
-version = "0.5.1"
+version = "0.5.2"
keywords = ["incremental", "parsing", "tree-sitter", "markdown"]
classifiers = [
"Intended Audience :: Developers",
@@ -17,7 +17,7 @@
authors = [
{name = "MDeiml"}
]
-requires-python = ">=3.9"
+requires-python = ">=3.10"
license.text = "MIT"
readme = "README.md"
@@ -28,5 +28,5 @@
core = ["tree-sitter~=0.23"]
[tool.cibuildwheel]
-build = "cp39-*"
+build = "cp310-*"
build-frontend = "build"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/setup.py
new/tree-sitter-markdown-0.5.2/setup.py
--- old/tree-sitter-markdown-0.5.1/setup.py 2025-09-16 19:08:32.000000000
+0200
+++ new/tree-sitter-markdown-0.5.2/setup.py 2026-01-11 11:44:35.000000000
+0100
@@ -1,30 +1,49 @@
-from pathlib import Path
-from platform import system
+from os import path
+from sysconfig import get_config_var
from setuptools import Extension, find_packages, setup
from setuptools.command.build import build
+from setuptools.command.build_ext import build_ext
+from setuptools.command.egg_info import egg_info
from wheel.bdist_wheel import bdist_wheel
class Build(build):
def run(self):
- if (block_queries := Path("tree-sitter-markdown", "queries")).is_dir():
- dest = Path(self.build_lib, "tree_sitter_markdown", "queries",
"markdown")
- self.copy_tree(str(block_queries), str(dest))
- if (inline_queries := Path("tree-sitter-markdown-inline",
"queries")).is_dir():
- dest = Path(self.build_lib, "tree_sitter_markdown", "queries",
"markdown_inline")
- self.copy_tree(str(inline_queries), str(dest))
+ if path.isdir("queries"):
+ dest = path.join(self.build_lib, "tree_sitter_markdown", "queries")
+ self.copy_tree("queries", dest)
super().run()
+class BuildExt(build_ext):
+ def build_extension(self, ext: Extension):
+ if self.compiler.compiler_type != "msvc":
+ ext.extra_compile_args = ["-std=c11", "-fvisibility=hidden"]
+ else:
+ ext.extra_compile_args = ["/std:c11", "/utf-8"]
+ if path.exists("src/scanner.c"):
+ ext.sources.append("src/scanner.c")
+ if ext.py_limited_api:
+ ext.define_macros.append(("Py_LIMITED_API", "0x030A0000"))
+ super().build_extension(ext)
+
+
class BdistWheel(bdist_wheel):
def get_tag(self):
python, abi, platform = super().get_tag()
if python.startswith("cp"):
- python, abi = "cp39", "abi3"
+ python, abi = "cp310", "abi3"
return python, abi, platform
+class EggInfo(egg_info):
+ def find_sources(self):
+ super().find_sources()
+ self.filelist.recursive_include("queries", "*.scm")
+ self.filelist.include("src/tree_sitter/*.h")
+
+
setup(
packages=find_packages("bindings/python"),
package_dir={"": "bindings/python"},
@@ -38,25 +57,21 @@
name="_binding",
sources=[
"bindings/python/tree_sitter_markdown/binding.c",
- "tree-sitter-markdown/src/parser.c",
- "tree-sitter-markdown/src/scanner.c",
- "tree-sitter-markdown-inline/src/parser.c",
- "tree-sitter-markdown-inline/src/scanner.c",
+ "src/parser.c",
],
- extra_compile_args=(
- ["-std=c11"] if system() != "Windows" else []
- ),
define_macros=[
- ("Py_LIMITED_API", "0x03090000"),
- ("PY_SSIZE_T_CLEAN", None)
+ ("PY_SSIZE_T_CLEAN", None),
+ ("TREE_SITTER_HIDE_SYMBOLS", None),
],
- include_dirs=["tree-sitter-markdown/src"],
- py_limited_api=True,
+ include_dirs=["src"],
+ py_limited_api=not get_config_var("Py_GIL_DISABLED"),
)
],
cmdclass={
"build": Build,
- "bdist_wheel": BdistWheel
+ "build_ext": BuildExt,
+ "bdist_wheel": BdistWheel,
+ "egg_info": EggInfo,
},
zip_safe=False
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown/bindings/c/tree-sitter/tree-sitter-markdown.h
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown/bindings/c/tree-sitter/tree-sitter-markdown.h
---
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown/bindings/c/tree-sitter/tree-sitter-markdown.h
1970-01-01 01:00:00.000000000 +0100
+++
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown/bindings/c/tree-sitter/tree-sitter-markdown.h
2026-01-11 11:44:35.000000000 +0100
@@ -0,0 +1,16 @@
+#ifndef TREE_SITTER_MARKDOWN_H_
+#define TREE_SITTER_MARKDOWN_H_
+
+typedef struct TSLanguage TSLanguage;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+const TSLanguage *tree_sitter_markdown(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // TREE_SITTER_MARKDOWN_H_
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown/bindings/c/tree-sitter-markdown.h
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown/bindings/c/tree-sitter-markdown.h
---
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown/bindings/c/tree-sitter-markdown.h
2025-09-16 19:08:32.000000000 +0200
+++
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown/bindings/c/tree-sitter-markdown.h
1970-01-01 01:00:00.000000000 +0100
@@ -1,16 +0,0 @@
-#ifndef TREE_SITTER_MARKDOWN_H_
-#define TREE_SITTER_MARKDOWN_H_
-
-typedef struct TSLanguage TSLanguage;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-const TSLanguage *tree_sitter_markdown(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // TREE_SITTER_MARKDOWN_H_
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown/queries/highlights.scm
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown/queries/highlights.scm
--- old/tree-sitter-markdown-0.5.1/tree-sitter-markdown/queries/highlights.scm
2025-09-16 19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/tree-sitter-markdown/queries/highlights.scm
2026-01-11 11:44:35.000000000 +0100
@@ -1,6 +1,9 @@
;From nvim-treesitter/nvim-treesitter
-(atx_heading (inline) @text.title)
-(setext_heading (paragraph) @text.title)
+(atx_heading
+ (inline) @text.title)
+
+(setext_heading
+ (paragraph) @text.title)
[
(atx_h1_marker)
@@ -19,19 +22,13 @@
(fenced_code_block)
] @text.literal
-[
- (fenced_code_block_delimiter)
-] @punctuation.delimiter
+(fenced_code_block_delimiter) @punctuation.delimiter
(code_fence_content) @none
-[
- (link_destination)
-] @text.uri
+(link_destination) @text.uri
-[
- (link_label)
-] @text.reference
+(link_label) @text.reference
[
(list_marker_plus)
@@ -47,6 +44,4 @@
(block_quote_marker)
] @punctuation.special
-[
- (backslash_escape)
-] @string.escape
+(backslash_escape) @string.escape
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown/queries/injections.scm
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown/queries/injections.scm
--- old/tree-sitter-markdown-0.5.1/tree-sitter-markdown/queries/injections.scm
2025-09-16 19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/tree-sitter-markdown/queries/injections.scm
2026-01-11 11:44:35.000000000 +0100
@@ -3,12 +3,23 @@
(language) @injection.language)
(code_fence_content) @injection.content)
-((html_block) @injection.content (#set! injection.language "html"))
+((html_block) @injection.content
+ (#set! injection.language "html"))
-(document . (section . (thematic_break) (_) @injection.content
(thematic_break)) (#set! injection.language "yaml"))
+(document
+ .
+ (section
+ .
+ (thematic_break)
+ (_) @injection.content
+ (thematic_break))
+ (#set! injection.language "yaml"))
-((minus_metadata) @injection.content (#set! injection.language "yaml"))
+((minus_metadata) @injection.content
+ (#set! injection.language "yaml"))
-((plus_metadata) @injection.content (#set! injection.language "toml"))
+((plus_metadata) @injection.content
+ (#set! injection.language "toml"))
-((inline) @injection.content (#set! injection.language "markdown_inline"))
+((inline) @injection.content
+ (#set! injection.language "markdown_inline"))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown/src/parser.c
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown/src/parser.c
--- old/tree-sitter-markdown-0.5.1/tree-sitter-markdown/src/parser.c
2025-09-16 19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/tree-sitter-markdown/src/parser.c
2026-01-11 11:44:35.000000000 +0100
@@ -1,4 +1,4 @@
-/* Automatically @generated by tree-sitter v0.25.9 */
+/* Automatically @generated by tree-sitter */
#include "tree_sitter/parser.h"
@@ -59777,7 +59777,7 @@
.metadata = {
.major_version = 0,
.minor_version = 5,
- .patch_version = 1,
+ .patch_version = 2,
},
};
return &language;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown-inline/bindings/c/tree-sitter/tree-sitter-markdown-inline.h
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/bindings/c/tree-sitter/tree-sitter-markdown-inline.h
---
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown-inline/bindings/c/tree-sitter/tree-sitter-markdown-inline.h
1970-01-01 01:00:00.000000000 +0100
+++
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/bindings/c/tree-sitter/tree-sitter-markdown-inline.h
2026-01-11 11:44:35.000000000 +0100
@@ -0,0 +1,16 @@
+#ifndef TREE_SITTER_MARKDOWN_INLINE_H_
+#define TREE_SITTER_MARKDOWN_INLINE_H_
+
+typedef struct TSLanguage TSLanguage;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+const TSLanguage *tree_sitter_markdown_inline(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // TREE_SITTER_MARKDOWN_INLINE_H_
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown-inline/bindings/c/tree-sitter-markdown-inline.h
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/bindings/c/tree-sitter-markdown-inline.h
---
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown-inline/bindings/c/tree-sitter-markdown-inline.h
2025-09-16 19:08:32.000000000 +0200
+++
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/bindings/c/tree-sitter-markdown-inline.h
1970-01-01 01:00:00.000000000 +0100
@@ -1,16 +0,0 @@
-#ifndef TREE_SITTER_MARKDOWN_INLINE_H_
-#define TREE_SITTER_MARKDOWN_INLINE_H_
-
-typedef struct TSLanguage TSLanguage;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-const TSLanguage *tree_sitter_markdown_inline(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // TREE_SITTER_MARKDOWN_INLINE_H_
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown-inline/queries/highlights.scm
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/queries/highlights.scm
---
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown-inline/queries/highlights.scm
2025-09-16 19:08:32.000000000 +0200
+++
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/queries/highlights.scm
2026-01-11 11:44:35.000000000 +0100
@@ -1,4 +1,4 @@
-;; From nvim-treesitter/nvim-treesitter
+; From nvim-treesitter/nvim-treesitter
[
(code_span)
(link_title)
@@ -29,9 +29,28 @@
(hard_line_break)
] @string.escape
-(image ["!" "[" "]" "(" ")"] @punctuation.delimiter)
-(inline_link ["[" "]" "(" ")"] @punctuation.delimiter)
-(shortcut_link ["[" "]"] @punctuation.delimiter)
+(image
+ [
+ "!"
+ "["
+ "]"
+ "("
+ ")"
+ ] @punctuation.delimiter)
+
+(inline_link
+ [
+ "["
+ "]"
+ "("
+ ")"
+ ] @punctuation.delimiter)
+
+(shortcut_link
+ [
+ "["
+ "]"
+ ] @punctuation.delimiter)
; NOTE: extension not enabled by default
; (wiki_link ["[" "|" "]"] @punctuation.delimiter)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown-inline/queries/injections.scm
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/queries/injections.scm
---
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown-inline/queries/injections.scm
2025-09-16 19:08:32.000000000 +0200
+++
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/queries/injections.scm
2026-01-11 11:44:35.000000000 +0100
@@ -1,2 +1,5 @@
-((html_tag) @injection.content (#set! injection.language "html"))
-((latex_block) @injection.content (#set! injection.language "latex"))
+((html_tag) @injection.content
+ (#set! injection.language "html"))
+
+((latex_block) @injection.content
+ (#set! injection.language "latex"))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.1/tree-sitter-markdown-inline/src/parser.c
new/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/src/parser.c
--- old/tree-sitter-markdown-0.5.1/tree-sitter-markdown-inline/src/parser.c
2025-09-16 19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/src/parser.c
2026-01-11 11:44:35.000000000 +0100
@@ -1,4 +1,4 @@
-/* Automatically @generated by tree-sitter v0.25.9 */
+/* Automatically @generated by tree-sitter */
#include "tree_sitter/parser.h"
@@ -75699,7 +75699,7 @@
.metadata = {
.major_version = 0,
.minor_version = 5,
- .patch_version = 1,
+ .patch_version = 2,
},
};
return &language;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.1/tree-sitter.json
new/tree-sitter-markdown-0.5.2/tree-sitter.json
--- old/tree-sitter-markdown-0.5.1/tree-sitter.json 2025-09-16
19:08:32.000000000 +0200
+++ new/tree-sitter-markdown-0.5.2/tree-sitter.json 2026-01-11
11:44:35.000000000 +0100
@@ -1,6 +1,6 @@
{
"metadata": {
- "version": "0.5.1",
+ "version": "0.5.2",
"license": "MIT",
"authors": [
{
@@ -38,5 +38,15 @@
"common/common.js"
]
}
- ]
+ ],
+ "bindings": {
+ "rust": true,
+ "node": true,
+ "c": true,
+ "python": true,
+ "swift": true,
+ "go": false,
+ "java": false,
+ "zig": false
+ }
}