Rust library for syntax highlighting using Sublime Text syntax definitions.
fancy-regex
engine optionUsers can now opt in to a pure-Rust regex engine using Cargo features, making
compilation easier in general. People experiencing difficulty compiling for
Windows and Wasm should try switching to fancy-regex
. Note this currently
approximately halves highlighting speed.
See the Readme and #270 for details. Thanks to @robinst for implementing this!
Upgrading should cause no errors for nearly all users. Users using more unusual APIs may have a small amount of tweaking to do.
default-features = false
you may need to update your features to choose a regex engineas_latex_escaped
utilHopefully no behavior changes.
Really a bug fix but the bug was not having an API be public so hence SemVer demands a minor version bump.
with_prototype
s (#220, fixes #160, #178, ASP highlighting)See previous release for major breaking changes and new things.
This is a major release with multiple breaking API changes, although upgrading shouldn't be too difficult. It fixes bugs and comes with some nice new features.
SyntaxSet
API has been revamped to use a builder and an arena of contexts. See example usage.SyntaxSet
that goes with the rest of their arguments because of this new arena.LoadingError::ParseSyntax
html
module now take the newlines
version of syntaxes.
SyntaxSet::add_syntax -> SyntaxSetBuilder::add
SyntaxSet::load_syntaxes -> SyntaxSetBuilder::add_from_folder
SyntaxSet::load_plain_text_syntax -> SyntaxSetBuilder::add_plain_text_syntax
html::highlighted_snippet_for_string -> html::highlighted_html_for_string
: also change to newlines
SyntaxSet
html::highlighted_snippet_for_file -> html::highlighted_html_for_file
: also change to newlines
SyntaxSet
html::styles_to_coloured_html -> html::styled_line_to_highlighted_html
: also change to newlines
SyntaxSet
html::start_coloured_html_snippet -> html::start_highlighted_html_snippet
: return type also changedSyntaxSetBuilder
API for constructing new SyntaxSet
snonewlines
mode is often buggy so we made it easier to use the newlines
mode.
LinesWithEndings
utility for iterating over the lines of a string with \n
characters.html
module to use newlines
syntaxes.split_at
and modify_range
in the util
module.ThemeSet::add_from_folder
function (#200): For modifying existing theme sets.set
: #177 #166embed
to not include prototypes: #172 #1600.2 -> 0.3
0.2 -> 1.0
3.2.1 -> 4.1
CMakeLists.txt