Commit 882952a
fix: prevent LaTeX parsing inside link text
Fixes #206
## Problem
When parsing links with dollar signs in the text, like:
`[$NVIM_APPNAME](https://example.com/$VAR)`
The parser incorrectly interpreted `$` inside link text as the start of
a LaTeX block, preventing the link from being parsed correctly.
## Root Cause
The `_inline_base` grammar rule included `$.latex_block`, which was used
in ALL inline contexts including inside link text (`_inline_element_no_link`).
## Solution
Created a new `_inline_base_no_latex` rule that excludes LaTeX blocks, and
modified the dynamic rule generation to use this variant when generating
`_inline_element_no_link` rules (used inside link text).
**Changes:**
- Added `_inline_base_no_latex` rule without `$.latex_block`
- Modified line 401 to use appropriate base rule based on context:
- Inside links (`link=false`): Use `_inline_base_no_latex`
- Outside links (`link=true`): Use `_inline_base` (with LaTeX)
## Testing
✅ All existing tests pass
✅ Links with `$` characters now parse correctly
✅ LaTeX still works outside of link text
## Additional Changes
Upgraded to tree-sitter 0.25 to match latest ABI (same as #207):
- Updated Cargo.toml dependencies
- Updated parser.rs API calls
Co-authored-by: Claude <[email protected]>1 parent 2dfd57f commit 882952a
File tree
298 files changed
+44359
-27285
lines changed- .cargo-build
- debug
- .fingerprint
- aho-corasick-7738203c4ed4e863
- aho-corasick-c587005507e12dc8
- cc-2fa476c52099d57c
- equivalent-486be9db8abd4cc8
- find-msvc-tools-baeaca4b40274e18
- hashbrown-6b55a23967fc6cf8
- indexmap-3554b3efd78e1dee
- itoa-05cfe16d81e3cc41
- memchr-3a13221c0f69344c
- memchr-5ccaf8db03d54111
- memchr-8696f8b9a9b03937
- regex-automata-b91883ad82e79d37
- regex-automata-e75d5a15a9d999bf
- regex-bd2cf714494b1a6a
- regex-e598ab770e82a9a3
- regex-syntax-3972fe9424549b4a
- regex-syntax-5d668b80e84c4546
- ryu-8f8598075d60b463
- serde_core-90ce1683e58127a1
- serde_core-e65192a4d20c7ed4
- serde_core-fd161cd0a1614837
- serde_json-244b0b0c65340c94
- serde_json-2562d9764ad76630
- serde_json-64279572b09ec031
- serde_json-bbc3d207aa81ef91
- shlex-cfca89ad6f32de44
- streaming-iterator-2c7f512fb10a4a2b
- streaming-iterator-e1740a43acc6c821
- tree-sitter-04aaf31955725c19
- tree-sitter-2b74bc6a54650ae6
- tree-sitter-30638de135801b31
- tree-sitter-3f7fb8f93c60d460
- tree-sitter-5dc0f34fbf4db5e1
- tree-sitter-942c175389823868
- tree-sitter-b2c2bc586cab5787
- tree-sitter-b2f904e27ae841bc
- tree-sitter-cf25bbc73abbd800
- tree-sitter-language-5a37aed41b4a567f
- tree-sitter-language-fdf239e95a640c3e
- tree-sitter-md-04fc524648393397
- tree-sitter-md-0a88d27b9f35112a
- tree-sitter-md-2ee431286e3e9e4c
- tree-sitter-md-389cf07103316271
- tree-sitter-md-7690b7cb238c2a44
- tree-sitter-md-77cd448a507323dc
- tree-sitter-md-7bbcebff5fac680e
- tree-sitter-md-83e74849f679918f
- tree-sitter-md-84e3285eb2c4e091
- tree-sitter-md-8e2c1a34eda3444b
- tree-sitter-md-b38f4312311d9b30
- tree-sitter-md-b8986b2958ad4116
- deps
- bindings/rust
- tree-sitter-markdown-inline
- src
- tree-sitter-markdown/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
298 files changed
+44359
-27285
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Whitespace-only changes.
Binary file not shown.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Binary file not shown.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments