Skip to content

v1.0.0

Compare
Choose a tag to compare
@slevithan slevithan released this 08 Jan 13:41
· 57 commits to main since this release

Most of the changes and fixes in this release resulted from feedback by @RedCMD. ✨

Note that every fix and newly-supported syntax in this release addresses an extreme edge case that did not affect even one regex in the tens of thousands of Oniguruma regexes found in the TextMate grammars provided by Shiki.

🚨 Breaking

  • Redesigned the recursion depth limit around the fact that Oniguruma uses a limit of 20 (rather than an infinite or high-value depth like other regex flavors). (#19)
    • Moved option maxRecursionDepth to rules.recursionLimit.
    • Changed the default recursionLimit from 5 to 20.
    • Reduced the max recursionLimit from 100 to 20.
    • Removed the ability to disable support for recursion.
    • Setting accuracy to 'strict' no longer disables recursion.

🚀 Features

  • Support \x{…} values above 10FFFF at the end of character class ranges. (#22)
  • Validate lookbehind contents and throw if not supported by Oniguruma. (#24)
  • Support possessive interval quantifiers specified using a reversed range. (#25)
  • Error at compile time rather than runtime for Unicode property names that start with a digit.
  • Improved test coverage.

🐞 Fixes

  • Don't remove negation for negated character classes used in intersection that contain a single token (bug applied when using target ES2024 or later and option verbose not enabled).
  • Ignore insignificant hyphens in Unicode property names. (#16)
  • Don't throw for intersection with an empty set. (#17)
  • Don't throw for character class ranges ending with literal hyphens followed by character or character-set tokens. (#18)