From 92ec869b6c61e00bd9875ab78efb6af0a4ac1054 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Thu, 15 Dec 2016 18:10:05 -0500 Subject: [PATCH] dont self-close elements - fixes #200 --- src/server-side-rendering/compile.js | 2 -- test/server-side-rendering/attribute-boolean/_actual.html | 2 +- test/server-side-rendering/attribute-static/_actual.html | 2 +- test/server-side-rendering/empty-elements-closed/_actual.html | 2 ++ test/server-side-rendering/empty-elements-closed/_expected.html | 2 ++ test/server-side-rendering/empty-elements-closed/main.html | 2 ++ test/server-side-rendering/static-div/_actual.html | 2 +- 7 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 test/server-side-rendering/empty-elements-closed/_actual.html create mode 100644 test/server-side-rendering/empty-elements-closed/_expected.html create mode 100644 test/server-side-rendering/empty-elements-closed/main.html diff --git a/src/server-side-rendering/compile.js b/src/server-side-rendering/compile.js index e34156745ac9..6bfcfd58e72e 100644 --- a/src/server-side-rendering/compile.js +++ b/src/server-side-rendering/compile.js @@ -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( '' ) + ``; diff --git a/test/server-side-rendering/attribute-boolean/_actual.html b/test/server-side-rendering/attribute-boolean/_actual.html index c45ee39b0f49..1536f3e1e882 100644 --- a/test/server-side-rendering/attribute-boolean/_actual.html +++ b/test/server-side-rendering/attribute-boolean/_actual.html @@ -1 +1 @@ - \ No newline at end of file diff --git a/test/server-side-rendering/attribute-static/_actual.html b/test/server-side-rendering/attribute-static/_actual.html index f82d79e45a9e..99ed594ea6c4 100644 --- a/test/server-side-rendering/attribute-static/_actual.html +++ b/test/server-side-rendering/attribute-static/_actual.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/test/server-side-rendering/empty-elements-closed/_actual.html b/test/server-side-rendering/empty-elements-closed/_actual.html new file mode 100644 index 000000000000..76a9da4e6ea4 --- /dev/null +++ b/test/server-side-rendering/empty-elements-closed/_actual.html @@ -0,0 +1,2 @@ + +

\ No newline at end of file diff --git a/test/server-side-rendering/empty-elements-closed/_expected.html b/test/server-side-rendering/empty-elements-closed/_expected.html new file mode 100644 index 000000000000..a6725f5e12fd --- /dev/null +++ b/test/server-side-rendering/empty-elements-closed/_expected.html @@ -0,0 +1,2 @@ + +

diff --git a/test/server-side-rendering/empty-elements-closed/main.html b/test/server-side-rendering/empty-elements-closed/main.html new file mode 100644 index 000000000000..a6725f5e12fd --- /dev/null +++ b/test/server-side-rendering/empty-elements-closed/main.html @@ -0,0 +1,2 @@ + +

diff --git a/test/server-side-rendering/static-div/_actual.html b/test/server-side-rendering/static-div/_actual.html index 78e7012b8224..281c6866c375 100644 --- a/test/server-side-rendering/static-div/_actual.html +++ b/test/server-side-rendering/static-div/_actual.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file