Skip to content

Commit

Permalink
Added test to ensure that the contents of <script type="text/..."> tags
Browse files Browse the repository at this point in the history
were left unmolested.  This is to ensure that script tags can be used
for some language other than Javascript.

The test data has a unit of whitespace at the very front to work around
tautologistics/node-htmlparser#29
  • Loading branch information
elfsternberg committed Nov 11, 2011
1 parent 44b545a commit d3b2afe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/jsdom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,17 @@ document.write("<SCR"+"IPT TYPE=\'text/javascript\' SRC=\'...\'><\/SCR"+"IPT>");
test.done();
},

issue_58_parse_templatedtags: function(test) {
var content = ' <%= cid %>'
var script = '<script type="text/x-underscore-tmpl">' + content + '</script>'
var html = '<html><head>' + script + '</head><body><p>hello world!</p></body></html>'
console.log(html);
var doc = jsdom.html(html)
doc.innerHTML = html;
test.equal(doc.head.childNodes[0].innerHTML, content);
test.done();
},

issue_239_replace_causes_script_execution : function(test) {
jsdom.env({
html : '<script type="text/javascript">window.a = 1;/* remove me */ console.log("executed?")</script>',
Expand Down

0 comments on commit d3b2afe

Please sign in to comment.