Ghost/core/server/helpers/encode.js
Vikas Potluri d989d62c10 Migrated encode, facebook_url and foreach helpers to es6 (#10655)
refs #9589 

* updated encode helper to use newer code standards
* updated facebook_url helper to use newer code standards
* updated foreach helper to use newer code standards
2019-04-22 17:54:42 +02:00

13 lines
268 B
JavaScript

// # Encode Helper
//
// Usage: `{{encode uri}}`
//
// Returns URI encoded string
const {SafeString} = require('./proxy');
module.exports = function encode(string, options) {
const uri = string || options;
return new SafeString(encodeURIComponent(uri));
};