Skip to content

Commit

Permalink
script tags are non-self-closing by default
Browse files Browse the repository at this point in the history
  • Loading branch information
sconover committed Dec 8, 2010
1 parent 4dc2548 commit 36af201
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion specs/node_spec.js
Expand Up @@ -12,9 +12,12 @@ describe("Jaml.Node", function() {
toEqual("<fooBar/>\n");
});

it("doesn't self-close for (for example) textarea", function(){
it("doesn't self-close for (for example) textarea and script", function(){
expect(new Jaml.Node("textarea").render()).
toEqual("<textarea></textarea>\n");

expect(new Jaml.Node("script").render()).
toEqual("<script></script>\n");
});

it("doesn't self-close if there are children", function(){
Expand Down
2 changes: 1 addition & 1 deletion specs/template_spec.js
Expand Up @@ -32,7 +32,7 @@ describe("Jaml.Template", function() {
}).render()).
toEqual("<html>\n" +
" <head>\n" +
" <meta/>\n <script/>\n <title/>\n <link/>\n" +
" <meta/>\n <script></script>\n <title/>\n <link/>\n" +
" </head>\n" +
" <body>\n" +
" <div/>\n <p/>\n <span/>\n <a/>\n <img/>\n" +
Expand Down
2 changes: 1 addition & 1 deletion src/Node.js
Expand Up @@ -137,7 +137,7 @@ Jaml.Node.prototype = {
* @type Array
* An array of all tags that should be self closing
*/
notSelfClosingTags: ['textarea']
notSelfClosingTags: ['textarea', 'script']
};

Jaml.TextNode = function(text) {
Expand Down

0 comments on commit 36af201

Please sign in to comment.