diff --git a/src/extensions/render.js b/src/extensions/render.js index bba6a9e..5949553 100644 --- a/src/extensions/render.js +++ b/src/extensions/render.js @@ -1,5 +1,6 @@ 'use strict'; +const nunjucks = require('nunjucks'); const utils = require('@frctl/fractal').utils; module.exports = function(fractal){ @@ -41,7 +42,7 @@ module.exports = function(fractal){ let env = JSON.parse(JSON.stringify(rootContext._env)); context._env = env; entity.render(context).then(html => { - callback(null, html); + callback(null, new nunjucks.runtime.SafeString(html)); }).catch(err => { callback(err); }); diff --git a/src/extensions/view.js b/src/extensions/view.js index 370e6ed..a8c6772 100644 --- a/src/extensions/view.js +++ b/src/extensions/view.js @@ -1,5 +1,7 @@ 'use strict'; +const nunjucks = require('nunjucks'); + module.exports = function(fractal){ function ViewExtension() { @@ -27,7 +29,7 @@ module.exports = function(fractal){ entity = entity.variants().default(); } entity.getContent().then(content => { - callback(null, content); + callback(null, new nunjucks.runtime.SafeString(content)); }).catch(err => { callback(err); });