Ghost/core/server/helpers/encode.js

13 lines
268 B
JavaScript
Raw Normal View History

// # 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));
};