Apologies - this is a second post as I somehow managed to post an incomplete post on the same topic moments ago by hitting some unknown keyboard combination!
I’ve written a couple of code editors over the years (I even sell one) but I’ve always been impressed by @Thomas_Tempelmann 's CustomEditField. What has put me off using it in the past is that its API 1.0 and its highlighting engine is RegEx based (which I dislike) whereas my engines have always been dedicated parsers and are API 2.0.
Anyway, the app I’m working on needs to highlight Markdown and highlight any code within code fences (```
). Currently, my editor (XUICodeEditor) can highlight Markdown but, full disclosure, I have some concerns about its performance with very large Markdown documents so I’m exploring other options.
I have two questions:
-
There is no current highlighter for Markdown. Fine - I’m happy to try to write one but do you think it is possible to write a Markdown highlighter definition using RegEx? I also thought that you needed a dedicated parser to do so. Our resident RegEx expert @Kem_Tekinay might be able to answer that.
-
Assuming (1) is possible, am I correct in thinking that CustomEditField would be able to highlight the contents of
```
fences differently if I marked them as different highlight contexts? I guess this question is aimed at anyone who has ever written one of these highlighters.
I know there are other code editors out there (@Christian_Schmitz’s Scintilla plugin is one) but as far as I can see, none of them highlight code within Markdown code fences.