So normally I hate diversions, but this one proved fruitful. I got a bit obsessed with the lack of ejs support in nide. Looking into the code, I realized the editors were integrated from another project: CodeMirror (git repo here). So I forked CodeMirror and started digging in.
The amount of code I added is pretty minimal, but it was trickier than I anticipated. I think I finally got it right though: https://github.com/whalefood/CodeMirror2
I'm still debating whether to send a pull request to the main branch. I'm not sure how popular ejs is and even the mode for mustache didn't make it to the main line. It would be cool to have my code integrated though. I guess no harm in asking. Next step: stick it in Nide.