Skip to content

Commit

Permalink
Merge pull request #201 from sveltejs/gh-200
Browse files Browse the repository at this point in the history
don't self-close elements
  • Loading branch information
Rich-Harris authored Dec 15, 2016
2 parents e016b20 + 92ec869 commit bb24ab6
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/server-side-rendering/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ export default function compile ( parsed, source, { filename }) {

if ( voidElementNames.test( node.name ) ) {
element += '>';
} else if ( node.children.length === 0 ) {
element += '/>';
} else {
elementDepth += 1;
element += '>' + node.children.map( stringify ).join( '' ) + `</${node.name}>`;
Expand Down
2 changes: 1 addition & 1 deletion test/server-side-rendering/attribute-boolean/_actual.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<textarea readonly/>
<textarea readonly></textarea>
2 changes: 1 addition & 1 deletion test/server-side-rendering/attribute-static/_actual.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="foo"/>
<div class="foo"></div>
2 changes: 2 additions & 0 deletions test/server-side-rendering/empty-elements-closed/_actual.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<a></a>
<p></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<a></a>
<p></p>
2 changes: 2 additions & 0 deletions test/server-side-rendering/empty-elements-closed/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<a></a>
<p></p>
2 changes: 1 addition & 1 deletion test/server-side-rendering/static-div/_actual.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div/>
<div></div>

0 comments on commit bb24ab6

Please sign in to comment.