thomasjo / highlight

A relatively simple and extensible syntax highlighter written in C#
MIT License
89 stars 28 forks source link

There's a bug in the test for CaseSensitivity in the Engine... #7

Closed adrianoconnor closed 2 years ago

adrianoconnor commented 5 years ago

Hi there,

I was looking at your project to try and figure a few things out (I was curious to see if the inline styles work better for pasting code in to a document...) and I spent a little while playing with it. While I was in there, I spotted a small bug in the Engine...

if (definition.CaseSensitive) {
  return DefaultRegexOptions | RegexOptions.IgnoreCase;
}

The check is the wrong way around, it should be: if (definition.CaseSensitive == false).

I've changed it in my cloned repo, and added a test for it; happy to send over a PR if you care. Wanted to post this here just on the off-chance somebody else hits the same thing and wonders why :)

Many thanks! Adrian

thomasjo commented 2 years ago

Fixed in #8