Skip to content

How to combine keywords with random markdown #1936

Answered by msujew
mimoduo asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @mimoduo,

I think there are multiple approaches to this problem:

  1. Add token delimiters to the markdown (similar to comments), so that they can be identified as single tokens. You could maybe argue that : and \n can be used as start and end sequences for the markdown token.
  2. Build a parser rule that's actually able to parse markdown. I'm not totally sure whether this is actually possible, due to markdown not being an LLk language.
  3. Build a custom tokenizer that returns markdown content as a single token. This is probably doable, but quite a bit of work. It's also arguably the cleanest solution that has no influence on the target language.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mimoduo
Comment options

Answer selected by mimoduo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants