refac nunjucks compile, string based replace