From 97edb4bee98f0a8513ec53d630a16f287aed5422 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Sun, 1 Dec 2013 15:30:28 -0500 Subject: [PATCH] Improve comment filtering in embed action --- scripts/embed.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/embed.lua b/scripts/embed.lua index 3ef6a594..e501e288 100644 --- a/scripts/embed.lua +++ b/scripts/embed.lua @@ -20,10 +20,12 @@ s = s:gsub("[\r]", "") -- strip out block comments - s = s:gsub("%-%-%[%[.-%-%-%]%]", "") + s = s:gsub("[^\"']%-%-%[%[.-%]%]", "") + s = s:gsub("[^\"']%-%-%[=%[.-%]=%]", "") + s = s:gsub("[^\"']%-%-%[==%[.-%]==%]", "") -- strip out inline comments - s = s:gsub("\n%-%-[^\n]*", "") + s = s:gsub("\n%-%-[^\n]*", "\n") -- escape backslashes s = s:gsub("\\", "\\\\") @@ -32,7 +34,7 @@ s = s:gsub("\n+", "\n") -- strip out leading comments - s = s:gsub("^%-%-\n", "") + s = s:gsub("^%-%-[^\n]*\n", "") -- escape line feeds s = s:gsub("\n", "\\n")