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

13 lines
278 B
JavaScript
Raw Normal View History

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