3 stable releases

6.0.0 Jan 3, 2025
5.2.0 Jan 2, 2025
4.6.1 Jan 23, 2022

#4 in #colouring

Download history 204/week @ 2024-09-26 192/week @ 2024-10-03 183/week @ 2024-10-10 362/week @ 2024-10-17 215/week @ 2024-10-24 276/week @ 2024-10-31 226/week @ 2024-11-07 245/week @ 2024-11-14 203/week @ 2024-11-21 265/week @ 2024-11-28 253/week @ 2024-12-05 208/week @ 2024-12-12 170/week @ 2024-12-19 322/week @ 2024-12-26 1114/week @ 2025-01-02 718/week @ 2025-01-09

2,352 downloads per month
Used in broot

MIT license

1MB
8K SLoC

syntect-no-panic

This is a fork of 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:

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.

Dependencies

~0.9–10MB
~113K SLoC