Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Auto-detect xml and do not self-close tags. Closes #147

  • Loading branch information...
commit 4a8e82f2f6cb41c2dcacf725916248ec021c1a8f 1 parent 96c8ba8
@tj tj authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/compiler.js
View
3  lib/compiler.js
@@ -120,6 +120,7 @@ Compiler.prototype = {
var name = doctype.val;
if ('5' == name) this.terse = true;
doctype = doctypes[name || 'default'];
+ this.xml = 0 == doctype.indexOf('<?xml');
if (!doctype) throw new Error('unknown doctype "' + name + '"');
this.buffer(doctype);
},
@@ -135,7 +136,7 @@ Compiler.prototype = {
visitTag: function(tag){
var name = tag.name;
- if (~selfClosing.indexOf(name)) {
+ if (~selfClosing.indexOf(name) && !this.xml) {
this.buffer('<' + name);
this.visitAttributes(tag.attrs);
this.terse
Please sign in to comment.
Something went wrong with that request. Please try again.