From b2129db547f89ec1e02bf0742cd08fe466867386 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Thu, 30 Jul 2020 14:54:22 -0500 Subject: [Bug, Command Tags] Strip end markers out of multi-line text blocks --- app/lib/command_tag/processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/lib') diff --git a/app/lib/command_tag/processor.rb b/app/lib/command_tag/processor.rb index aa22c6311..cb447f851 100644 --- a/app/lib/command_tag/processor.rb +++ b/app/lib/command_tag/processor.rb @@ -137,7 +137,7 @@ class CommandTag::Processor statement = unescape_literals(Regexp.last_match(0).strip[2..-1]) next if statement.blank? - statement_array = statement.scan(/'([^']*)'|"([^"]*)"|(\S+)|\s+(?:start|begin|do)\s*$\n+(.*)/im).flatten.compact + statement_array = statement.scan(/'([^']*)'|"([^"]*)"|(\S+)|\s+(?:start|begin|do)\s*$\n+(.*)\n\s*#!\s*(?:end|stop|done)\s*\z/im).flatten.compact statement_array[0] = statement_array[0].strip.tr(':.\- ', '_').gsub(/__+/, '_').downcase next unless statement_array[0].match?(/\A[\w_]+\z/) -- cgit