Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter-language = "0.1"
tree-sitter = { version = "0.24", optional = true }
tree-sitter = { version = "0.25", optional = true }

[dev-dependencies]
tree-sitter = "0.24.3"
tree-sitter = "0.25"

[build-dependencies]
cc = "1.1.22"
Expand Down
11 changes: 8 additions & 3 deletions bindings/rust/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl MarkdownTree {
}

/// 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(),
Expand Down Expand Up @@ -272,7 +272,11 @@ impl MarkdownParser {
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),
None, // No progress callback
)?;
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))
Expand Down Expand Up @@ -322,9 +326,10 @@ impl MarkdownParser {
}
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)),
None, // No progress callback
)?;
inline_trees.push(inline_tree);
inline_indices.insert(node.id(), i);
Expand Down
2 changes: 1 addition & 1 deletion common/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports.rules = {
)), ']'),

link_destination: $ => prec.dynamic(PRECEDENCE_LEVEL_LINK, choice(
seq('<', repeat(choice($._text_no_angle, $.backslash_escape, $.entity_reference, $.numeric_character_reference)), '>'),
seq('<', alias(repeat(choice($._text_no_angle, $.backslash_escape, $.entity_reference, $.numeric_character_reference)), $.link_destination), '>'),
seq(
choice( // first character is not a '<'
$._word,
Expand Down
47 changes: 26 additions & 21 deletions tree-sitter-markdown-inline/src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions tree-sitter-markdown-inline/src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading