Permalink
Browse files

replace @closed = 'self' with @isselfclosing

  • Loading branch information...
dodo committed Nov 9, 2013
1 parent 99b8083 commit 697090fe57d2e336b7dfb5e11396db3434e1b0ea
Showing with 7 additions and 6 deletions.
  1. +7 −6 src/xml.coffee
View
@@ -117,9 +117,10 @@ class Tag extends EventEmitter
@parent = @builder
@closed = no
@writable = true
- @hidden = no
+ @hidden = no
@isready = no
@isempty = yes
+ @isselfclosing = no
@content = ""
@children children, opts
@$tag = sync_tag
@@ -208,12 +209,12 @@ class Tag extends EventEmitter
end: () =>
if not @closed
+ if @isempty
+ @isempty = no
+ @isselfclosing = yes
@closed = 'approving'
close_tag = =>
- if @isempty
- @closed = 'self'
- else
- @closed = yes
+ @closed = yes
@emit 'close', this
@writable = false
set_ready = =>
@@ -240,7 +241,7 @@ class Tag extends EventEmitter
toString: () =>
"<#{@name}#{new_attrs @attrs}" +
- if @closed is 'self'
+ if @isempty
"/>"
else if @closed
">#{@content}</#{@name}>"

0 comments on commit 697090f

Please sign in to comment.