It looks like what we have to do is check if each TemplateData node's value contains any of the format's O_OPEN, O_CLOSE, C_OPEN, or C_CLOSE strings, and escape it accordingly. This actually makes more sense because the delimiters will vary by engine, so ERBs can escape only the values they need to.
Currently, Nunjucks'
raw
filter doesn't produce an AST node that we can use to easily map to the equivalent escape tags in other templating systems:produces:
It looks like what we have to do is check if each
TemplateData
node'svalue
contains any of the format'sO_OPEN
,O_CLOSE
,C_OPEN
, orC_CLOSE
strings, and escape it accordingly. This actually makes more sense because the delimiters will vary by engine, so ERBs can escape only the values they need to.