Skip to content

0.6.0: Add `state.prevCapture`

Compare
Choose a tag to compare
@ariabuckles ariabuckles released this 19 Sep 02:07
· 44 commits to master since this release

Adds a new state.prevCapture during parsing, so that match functions can use it instead of the third parameter to match(). This state.prevCapture is now an regex match object, the result of the last successful call to match, or null if this is the first found match.

Unlike the previous third parameter to match(), state.prevCapture is not reset to empty during nested parse traversals, giving you a more accurate view of the previous capture during nested parses (i.e. inside of block elements)