diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2023-01-26 09:42:23 +0100 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2023-01-28 11:28:52 +0100 |
| commit | c032e83b22994332dd8769ef34cb817906a63cac (patch) | |
| tree | 5c2d8c7131e07c1a6597c496d018e60e706e4cda /runtime/doc | |
| parent | b4c4c232ba6fe3df5c6f12faff4405a16e4d40df (diff) | |
| download | rneovim-c032e83b22994332dd8769ef34cb817906a63cac.tar.gz rneovim-c032e83b22994332dd8769ef34cb817906a63cac.tar.bz2 rneovim-c032e83b22994332dd8769ef34cb817906a63cac.zip | |
fix(treesitter): validate language name
Problem: Some injections (like markdown) allow specifying arbitrary
language names for code blocks, which may be lead to errors when
looking for a corresponding parser in runtime path.
Solution: Validate that the language name only contains alphanumeric
characters and `_` (e.g., for `c_sharp`) and error otherwise.
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/treesitter.txt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 917863eef8..9bfdc0b94e 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -684,6 +684,7 @@ require_language({lang}, {path}, {silent}, {symbol_name}) Parameters: ~ • {lang} (string) Language the parser should parse + (alphanumerical and `_` only) • {path} (string|nil) Optional path the parser is located at • {silent} (boolean|nil) Don't throw an error if language not found |