Skip to content

Commit

Permalink
fix(package): don't escape HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
ToQoz committed Dec 19, 2015
1 parent 6fab78e commit f3c5d99
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ module.exports = function(parameters) {
data = workaroundAwsObjectSerialization(data);

var ast = Velocity.parse(template.toString());
return (new Velocity.Compile(ast)).render(data);
var config = {
escape: false, // don't escape HTML
};
return (new Velocity.Compile(ast, config)).render(data);
};

// Workaround to followings
Expand Down
9 changes: 9 additions & 0 deletions test/renderer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var assert = require('assert');
var mappingTemplate = require('../');

describe("escape HTML", function() {
it("DO NOT", function() {
assert.equal(mappingTemplate({template: '$input.path("$")', payload: "<h1></h1>"}), '<h1></h1>');
assert.equal(mappingTemplate({template: '$input.path("$")', payload: "<h1></h1>"}), '<h1></h1>');
});
});

0 comments on commit f3c5d99

Please sign in to comment.