Skip to content

Reject self-referential custom syntax includes - #3879

Open
jackwalkerlabs wants to merge 2 commits into
sharkdp:masterfrom
jackwalkerlabs:fix/recursive-syntax-cache
Open

Reject self-referential custom syntax includes#3879
jackwalkerlabs wants to merge 2 commits into
sharkdp:masterfrom
jackwalkerlabs:fix/recursive-syntax-cache

Conversation

@jackwalkerlabs

Copy link
Copy Markdown

Summary

  • reject custom include: scope: references that resolve back to the same custom syntax before syntect links them
  • prevent cache files that can trigger unbounded highlighting recursion from being written
  • cover both the recursive case and a valid include from another scope

Fixes #3878.

Testing

  • cargo fmt -- --check
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • cargo test --locked

AI assistance was used for implementation and test scaffolding; the final diff and validation output were inspected locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant