From 4ce944804d703168506e31edd4d5778b7349c931 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 15 Feb 2015 17:13:40 -0800 Subject: [PATCH 1/2] Fix escaping in importHTML / html. --- Gruntfile.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index ab1c4f6e8..f472d1977 100755 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -1,8 +1,11 @@ module.exports = (grunt) -> grunt.util.linefeed = '\n' + json = (data) -> + "`#{JSON.stringify(data).replace(/`/g, '\\`')}`" + importHTML = (filename) -> - "(innerHTML: #{JSON.stringify grunt.file.read("src/General/html/#{filename}.html").replace(/^ +| +$ parts = template.split /([\$&@]){([^}`]*)}/ @@ -11,7 +14,7 @@ module.exports = (grunt) -> for part, i in parts switch i % 3 when 0 - parts2.push JSON.stringify part unless part is '' + parts2.push json part unless part is '' checkText += part when 1 if /<[^>]*$/.test(checkText) and not (part is '$' and /\=['"][^"'<>]*$/.test checkText) @@ -27,7 +30,7 @@ module.exports = (grunt) -> assert = (statement, objs...) -> return '' unless grunt.config('pkg').tests_enabled - "throw new Error 'Assertion failed: ' + `#{JSON.stringify statement}` unless #{statement}" + "throw new Error 'Assertion failed: ' + `#{json statement}` unless #{statement}" # Project configuration. grunt.initConfig From 9ac2500e3825a166ad41a04324129543cefadd81 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 15 Feb 2015 17:15:23 -0800 Subject: [PATCH 2/2] LICENSE is a built file and will be built with LF not CRLF. --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index f3760d287..8da07943f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,6 +2,7 @@ * text=auto builds/* -text +LICENSE -text # Custom for Visual Studio *.cs diff=csharp