We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
.strip
:code
1 parent 7644501 commit 86a0635Copy full SHA for 86a0635
lib/ruby_ast_gen/erb_to_ruby_transformer.rb
@@ -71,11 +71,13 @@ def visit(node)
71
@output << "#{buffer_to_use} << \"#{@static_buff.join('\n').gsub(/(?<!\\)"/, '')}\""
72
@static_buff = [] # clear static buffer
73
end
74
- code = node[1].to_s.strip
+
75
+ stripped_code = node[1].to_s.strip
76
+ code = node[1].to_s
77
# Using this to determine if we should throw a StandardError for "invalid" ERB
- if is_control_struct_start(code)
78
+ if is_control_struct_start(stripped_code)
79
@in_control_block = true
- @output << code
80
+ @output << stripped_code
81
elsif code.start_with?("end")
82
if @in_do_block
83
@in_do_block = false
0 commit comments