You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prism's token syntax is helpful for certain things, but for other use cases a single regex with named capturing groups can be easier.
I propose we just use all named capturing groups as token names (automatically converted to kebab-case)
If that becomes a problem, we can introduce a setting to ignore some of them.
This can be combined with regular tokens, they'd just operate on the unmatched text. The tokens matched in the regex can also be specified again in the literal if we want to specify inside or $language. E.g. imagine something like this for the markdown code blocks:
Uh oh!
There was an error while loading. Please reload this page.
Prism's token syntax is helpful for certain things, but for other use cases a single regex with named capturing groups can be easier.
I propose we just use all named capturing groups as token names (automatically converted to kebab-case)
If that becomes a problem, we can introduce a setting to ignore some of them.
This can be combined with regular tokens, they'd just operate on the unmatched text. The tokens matched in the regex can also be specified again in the literal if we want to specify
inside
or$language
. E.g. imagine something like this for the markdown code blocks:Note that this means
inside
can also be a regex now.Here's a more substantial example: 586bd55
The text was updated successfully, but these errors were encountered: