Permalink
Browse files

Removed CDATA from :javascript. Closes #47

  • Loading branch information...
1 parent 7b7e57d commit dc99fea1b75338e14119394d2bdd4f870e53237c @tj tj committed Aug 4, 2010
Showing with 5 additions and 5 deletions.
  1. +1 −1 lib/jade.js
  2. +4 −4 test/filters.test.js
View
@@ -82,7 +82,7 @@ var filters = exports.filters = {
*/
javascript: function(str){
- return '<script type="text/javascript">\\n//<![CDATA[\\n' + str + '\\n//]]></script>';
+ return '<script type="text/javascript">\\n' + str + '</script>';
},
/**
View
@@ -11,13 +11,13 @@ var render = jade.render;
module.exports = {
'test filter interpolation': function(assert){
assert.equal(
- '<script type="text/javascript">\n//<![CDATA[\nvar name = "tj";\n//]]></script>',
+ '<script type="text/javascript">\nvar name = "tj";</script>',
render(':javascript\n | var name = "#{userName}";', { locals: { userName: 'tj' }}));
assert.equal(
- '<script type="text/javascript">\n//<![CDATA[\nvar name = \'tj\';\n//]]></script>',
+ '<script type="text/javascript">\nvar name = \'tj\';</script>',
render(':javascript\n | var name = #{userName};', { locals: { userName: "'tj'" }}));
assert.equal(
- '<script type="text/javascript">\n//<![CDATA[\nvar name = "#{userName}";\n//]]></script>',
+ '<script type="text/javascript">\nvar name = "#{userName}";</script>',
render(':javascript\n | var name = "\\#{userName}";', { locals: { userName: 'tj' }}));
},
@@ -29,7 +29,7 @@ module.exports = {
'test :javascript filter': function(assert){
assert.equal(
- '<script type="text/javascript">\n//<![CDATA[\nalert(\'foo\')\n//]]></script>',
+ '<script type="text/javascript">\nalert(\'foo\')</script>',
render(':javascript\n | alert(\'foo\')'));
},

0 comments on commit dc99fea

Please sign in to comment.