Perhaps the best solution would be to modify mustache.js. Offensive line seems to be on line 106 with regex
this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag
Which corresponds to an open tag followed by ^ or # , then any number of spaces, then at least one character, then any number of spaces.
I'm not the best in regular expression, but an opening tag would follow with the statement that it cannot match {{\^ or {{\# :
this.otag + "(?!\\\\)(\\^|\\#)\\s*(.+)\\s*" + this.ctag
Four-time backslashes are interpreted by javascript as \\ + \\ = \\ , and then regex as \ + \ = \ . I have not tested this, but it should work.
If this works for you, consider opening a migration request for your change in the GitHub repository
EDIT: I missed the following: on line 152 , it looks like you need to add a similar statement. I will leave this as an exercise for the reader.
source share