From 6d8543f6ed6a8fce5d568b5b47ae73c86ef799a7 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 25 Jan 2017 18:16:18 -0500 Subject: [PATCH] fix apostrophe entity (#267) --- src/generators/server-side-rendering/index.js | 2 +- test/server-side-rendering/dynamic-text-escaped/_actual.html | 2 +- test/server-side-rendering/dynamic-text-escaped/_expected.html | 2 +- test/server-side-rendering/entities/_actual.html | 1 + test/server-side-rendering/entities/_expected.html | 1 + test/server-side-rendering/entities/data.json | 3 +++ test/server-side-rendering/entities/main.html | 1 + 7 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 test/server-side-rendering/entities/_actual.html create mode 100644 test/server-side-rendering/entities/_expected.html create mode 100644 test/server-side-rendering/entities/data.json create mode 100644 test/server-side-rendering/entities/main.html diff --git a/src/generators/server-side-rendering/index.js b/src/generators/server-side-rendering/index.js index d74c720036..3187622f79 100644 --- a/src/generators/server-side-rendering/index.js +++ b/src/generators/server-side-rendering/index.js @@ -112,7 +112,7 @@ export default function ssr ( parsed, source, options, names ) { var escaped = { '"': '"', - "'": '&39;', + "'": ''', '&': '&', '<': '<', '>': '>' diff --git a/test/server-side-rendering/dynamic-text-escaped/_actual.html b/test/server-side-rendering/dynamic-text-escaped/_actual.html index 467e5de3d1..cd875b439e 100644 --- a/test/server-side-rendering/dynamic-text-escaped/_actual.html +++ b/test/server-side-rendering/dynamic-text-escaped/_actual.html @@ -1 +1 @@ -<p>this should be <em>escaped</em> & so should &39;this&39;</p> \ No newline at end of file +<p>this should be <em>escaped</em> & so should 'this'</p> \ No newline at end of file diff --git a/test/server-side-rendering/dynamic-text-escaped/_expected.html b/test/server-side-rendering/dynamic-text-escaped/_expected.html index 080992cfd2..20f85b71be 100644 --- a/test/server-side-rendering/dynamic-text-escaped/_expected.html +++ b/test/server-side-rendering/dynamic-text-escaped/_expected.html @@ -1 +1 @@ -<p>this should be <em>escaped</em> & so should &39;this&39;</p> +<p>this should be <em>escaped</em> & so should 'this'</p> diff --git a/test/server-side-rendering/entities/_actual.html b/test/server-side-rendering/entities/_actual.html new file mode 100644 index 0000000000..a7d44dafd3 --- /dev/null +++ b/test/server-side-rendering/entities/_actual.html @@ -0,0 +1 @@ +it's working \ No newline at end of file diff --git a/test/server-side-rendering/entities/_expected.html b/test/server-side-rendering/entities/_expected.html new file mode 100644 index 0000000000..852764fc3f --- /dev/null +++ b/test/server-side-rendering/entities/_expected.html @@ -0,0 +1 @@ +it's working diff --git a/test/server-side-rendering/entities/data.json b/test/server-side-rendering/entities/data.json new file mode 100644 index 0000000000..fb52b739cf --- /dev/null +++ b/test/server-side-rendering/entities/data.json @@ -0,0 +1,3 @@ +{ + "foo": "it's working" +} diff --git a/test/server-side-rendering/entities/main.html b/test/server-side-rendering/entities/main.html new file mode 100644 index 0000000000..054e96cb81 --- /dev/null +++ b/test/server-side-rendering/entities/main.html @@ -0,0 +1 @@ +{{foo}}