File: Readme.md

package info (click to toggle)
rust-syntect-no-panic 6.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,080 kB
  • sloc: makefile: 2
file content (25 lines) | stat: -rw-r--r-- 1,045 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# syntect-no-panic

This is a fork of [Syntect](https://crates.io/crates/syntect).

This fork is very similar to the original version 5.2 of Syntect, but modified to avoid panicking.

With this fork, the behavior on a syntax having an invalid rule isn't to panic anymore, and is tuned with options:

```rust
let options = HighlightOptions {
    ignore_errors: true,
    ..Default::default()
};
HighlightLines::new(syntax, theme, options)
```

With `ignore_errors: false`, a faulty regex in a syntax, detected when highlighting some lines, will result in an error.

With `ignore_errors: true`, the rule containing the faulty regex won't be applied but rest of the highlighting process will proceed.

Please try to use the original Syntect instead of this temporary fork.

There's no project to add features: as soon as I can use the normal syntect, this repository will be considered obsolete to avoid fragmenting the ecosystem.

If you really feel like you need to use this, contact @dystroy on [the Miaou chat](https://miaou.dystroy.org/3768).