inlineRegexp with the new Markdown-it


Had a few plugins that utilized inlineRegexp and worked great until the switch to Markdown-it.

I’m completely lost with the new markdown-it… Any suggestion or example plugins that I might be able to look at?

My regex matcher was something like:

matcher: /^\[custom-tag1:([a-z]{2}\d{10})(?:\:([a-z0-9_-]+))?\]/i,

Any help or suggestions would be greatly appreciated!

Mini (Inline) Onebox Support RFC
(Sam Saffron) #2

Have a look at discourse/mentions.js.es6 at master · discourse/discourse · GitHub , the one issue though is that I do not yet support capture groups, I will see if I can add that.


Thanks, it really helps to see a working example!

(Sam Saffron) #4

OK, per:

We now support multiple capture groups each the rule, this should make it way easier to implement your plugin.