diff --git a/app/node_controllers/resultsController.js b/app/node_controllers/resultsController.js index de3b122..9c135a1 100644 --- a/app/node_controllers/resultsController.js +++ b/app/node_controllers/resultsController.js @@ -34,9 +34,14 @@ var resultsController = function(req, res, googleAnalyticsId) { return res.status(404).send('Sorry, test not found...'); } + // Escape "" because it can interfer with the HTML parser + var phantomasResults = results.phantomasResults; + phantomasResults = phantomasResults.replace('', '\\u003c/script>'); + + var html = results.htmlTemplate; html = html.replace('%%METADATA%%', results.phantomasMetadata); - html = html.replace('%%RESULTS%%', results.phantomasResults); + html = html.replace('%%RESULTS%%', phantomasResults); html = html.replace('%%GA_ID%%', googleAnalyticsId); res.setHeader('Content-Type', 'text/html');