0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/core/server/helpers/encode.js

16 lines
304 B
JavaScript
Raw Normal View History

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