How to use the ejs/lib/utils.escape function in ejs

To help you get started, we’ve selected a few ejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github citelab / JAMScript / lib / jdiscovery / mdns / utils / lib / ncov.js View on Github external
if (lines[lines.length - 1] === '') {
    lines.pop()
  }

  var metadata =
    { stylesheets: 
      [ '/stylesheets/mdns.css'
      , '/stylesheets/build_status.css'
      ]
    , scripts: []
    , title: 'Test Coverage of ' + name
    };
  var locals = { lines: lines
               , coverage: coverage
               , path: name.split('/')
               , escape: require('ejs/lib/utils').escape
               , counts: found_and_hit(coverage, functions)
               };
  locals = obj.union(locals, view.helpers(metadata, {outputDir: pagedir, dst: dst}));
  metadata.body = ejs.render(meta.source_template.toString(), locals);
  metadata.path = view.getPathHelper({outputDir: pagedir, dst: dst});
  var html = ejs.render(meta.layout.toString(), metadata);
  cb(null, html);
}
github agnat / node_mdns / utils / lib / ncov.js View on Github external
if (lines[lines.length - 1] === '') {
    lines.pop()
  }

  var metadata =
    { stylesheets: 
      [ '/stylesheets/mdns.css'
      , '/stylesheets/build_status.css'
      ]
    , scripts: []
    , title: 'Test Coverage of ' + name
    };
  var locals = { lines: lines
               , coverage: coverage
               , path: name.split('/')
               , escape: require('ejs/lib/utils').escape
               , counts: found_and_hit(coverage, functions)
               };
  locals = obj.union(locals, view.helpers(metadata, {outputDir: pagedir, dst: dst}));
  metadata.body = ejs.render(meta.source_template.toString(), locals);
  metadata.path = view.getPathHelper({outputDir: pagedir, dst: dst});
  var html = ejs.render(meta.layout.toString(), metadata);
  cb(null, html);
}