Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #12 from frctl/render-escaping
Browse files Browse the repository at this point in the history
Fix render extension output being escaped
  • Loading branch information
allmarkedup authored Apr 24, 2019
2 parents 462c075 + c455170 commit 8785933
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/extensions/render.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

const nunjucks = require('nunjucks');
const utils = require('@frctl/fractal').utils;

module.exports = function(fractal){
Expand Down Expand Up @@ -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);
});
Expand Down
4 changes: 3 additions & 1 deletion src/extensions/view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

const nunjucks = require('nunjucks');

module.exports = function(fractal){

function ViewExtension() {
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 8785933

Please sign in to comment.