This is the same method used in some text editors (e.g. Scite uses this exact same method for variables, $() ).
Alexander Malakhov wrote:RPAREN=)
Also, for example, what if I want to put extra ')' paren into $(D text)?
I think there is (simple) solution, but that is one more thing to learn.
$(D text $(RPAREN) )
You'll see a few of those in the macros, in particular $(DOLLAR) to embed a dollar sign. It's not so bad, every markup language needs an escape method.