Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed CDATA from :javascript. Closes #47

  • Loading branch information...
commit dc99fea1b75338e14119394d2bdd4f870e53237c 1 parent 7b7e57d
@tj tj authored
Showing with 5 additions and 5 deletions.
  1. +1 −1  lib/jade.js
  2. +4 −4 test/filters.test.js
View
2  lib/jade.js
@@ -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
8 test/filters.test.js
@@ -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\')'));
},
Please sign in to comment.
Something went wrong with that request. Please try again.