Ghost/core/server/helpers/encode.js

14 lines
292 B
JavaScript
Raw Normal View History

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