File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ def visit(node)
118118 when :code
119119 flush_static_block
120120 stripped_code = node [ 1 ] . to_s . gsub ( "-" , "" ) . strip
121- code = node [ 1 ] . to_s . gsub ( "-" , "" )
121+ code = if node [ 1 ] . strip . start_with? ( "-" ) then node [ 1 ] . to_s . gsub ( "-" , "" ) else node [ 1 ] . to_s end
122122 # Using this to determine if we should throw a StandardError for "invalid" ERB
123123 if is_control_struct_start ( stripped_code )
124124 @in_control_block = true
@@ -174,7 +174,7 @@ def lower_do_block(code)
174174 if ( code_match = code . match ( /do\s +(?:\| ([^|]*)\| )?/ ) || code . end_with? ( 'do' ) )
175175 if code . include? ( "=" )
176176 @output << code
177- elsif code . include ?( "end" )
177+ elsif code . strip . end_with ?( "end" )
178178 ast = extract_ast ( code )
179179 if ast . is_a? ( ::Parser ::AST ::Node )
180180 case ast . type
You can’t perform that action at this time.
0 commit comments