Replacing Markdown strings with DOM Elements

Howdy

Wondering if anyone has a best practice / solution:

I have some Markdown generated by Dropbox Paper. Dropbox MD supports [ ] to denote a “to-do” item. We’re downloading these md files and using them in middleman. However, vanilla middleman / red-carpet doesn’t know what to do with these “[ ]” strings.

What I’d like to do is replicate the Dropbox Paper functionality and have middleman or it’s markdown processor look for the brackets string and replace it with a checkbox input. I’m at a loss on how to do this. I’ve looked up multiple JS solutions; but from what I have found is it’s easier said than done.

A markdown plugin is an option, but I have no idea how to tackle that.

Any suggestions would be super helpful!

Thanks!