-
-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
Description
Say I want to make a parser for a markdown file but it's able to contain tags/annotations like @foo(bar). I want to color the contents of bar but only if there's a @foo before it - so I tried something like this:
var parser = new Parser({
whitespace: /\s+/,
tagKey: /@\w+/,
tagValue: /(?<=@\w+)\([^\)]+\)/,
other: /\S/
});But this did not work. When I read the api for a parser, I realized that it's probably first breaking them into separate tokens and then applying the regexes to recognize the type of each token.
Is there a way to achieve what I want or does the api not support this? Maybe you could have support for parsers that can do both .tokenize() and .identify() in one go which would allow this?
Reactions are currently unavailable