Conversation
- Add the missing inside token and fix the existing one - Fix the regexp that is too greedy now: if we have more than one code block next to each other, all of them starting from the second one will be interpreted as a code block of the first one
13c01ce to
8ac2853
Compare
LeaVerou
left a comment
There was a problem hiding this comment.
I thought I added code in tokenize() to support functional tokens?
You did. It covers functional If, OTOH, we have parts that are not in a group (like ”```“ in a code block in Markdown), we tokenize it by passing the same grammar (with functional tokens): prism/src/core/tokenize/match.ts Line 174 in b86c4e0 While tokenizing, we iterate over the grammar’s tokens: prism/src/core/tokenize/match.ts Line 27 in b86c4e0 These functional tokens are not regular expressions, and when we call prism/src/core/tokenize/match.ts Line 131 in b86c4e0 prism/src/core/tokenize/match.ts Line 224 in b86c4e0 |
However, to fully support it, we need to support functional tokens first. For now, we don't, and we work with it as it is a regex, or an object with the
patternproperty. In both cases,matchPattern()(intokenize/match.ts) throws.