javascriptmustache

How to change the don't-escape HTML delimiter in Mustache.js


I know I can change the default delimiter using Mustache.tags('[[', ']]');

I dig into the source code, but I can't find and figure out how to change the don't-escape HTML delimiter, which is {{{ }}} by default. Any help is appreciated.


Solution

  • Changing the don't-escape HTML delimiter is only possible by modifying the source because it's hardcoded into the parser and defined as openingTag + "{" and "}" + closingTag.

    And by hardcoded I mean that you'd possibly have to change logic, not just a (few) regex. Thanks to @Thomas for dedicating his time to me.