Skip to content

Commit 882952a

Browse files
mikkihugoclaude
andcommitted
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

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

.cargo-build/.rustc_info.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"rustc_fingerprint":12804032629524293850,"outputs":{"12016735552878863467":{"success":true,"status":"","code":0,"stdout":"rustc 1.89.0 (29483883e 2025-08-04) (built from a source tarball)\nbinary: rustc\ncommit-hash: 29483883eed69d5fb4db01964cdf2af4d86e9cb2\ncommit-date: 2025-08-04\nhost: x86_64-unknown-linux-gnu\nrelease: 1.89.0\nLLVM version: 20.1.8\n","stderr":""},"11218871593177278256":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/nix/store/lami1gbfhz609fd6d8pi91sxppvyvq8r-rustc-1.89.0\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""}},"successes":{}}

.cargo-build/CACHEDIR.TAG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Signature: 8a477f597d28d172789f06886806bc55
2+
# This file is a cache directory tag created by cargo.
3+
# For information about cache directory tags see https://bford.info/cachedir/

.cargo-build/debug/.cargo-lock

Whitespace-only changes.
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file has an mtime of when this was started.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
123e5ee5975dce26
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"rustc":5132438200927386773,"features":"[\"perf-literal\", \"std\"]","declared_features":"[\"default\", \"logging\", \"perf-literal\", \"std\"]","target":7534583537114156500,"profile":15657897354478470176,"path":10193214930620539763,"deps":[[198136567835728122,"memchr",false,13820160976748072317]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/aho-corasick-7738203c4ed4e863/dep-lib-aho_corasick","checksum":false}}],"rustflags":["-C","linker=gcc","-C","link-arg=-fuse-ld=mold"],"config":2069994364910194474,"compile_kind":0}
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file has an mtime of when this was started.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9324a0cc04a67f91

0 commit comments

Comments
 (0)