Skip to content

Commit cf44130

Browse files
committed
Move <% case above <%# and <%% cases as it is more common
1 parent d20b4ed commit cf44130

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/erubi.rb

+8-8
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ def initialize(input, properties={})
139139
rspace = nil if tailch && !tailch.empty?
140140
add_expression(indicator, code)
141141
add_text(rspace) if rspace
142+
when nil, '-'
143+
if trim && lspace && rspace
144+
add_code("#{lspace}#{code}#{rspace}")
145+
else
146+
add_text(lspace) if lspace
147+
add_code(code)
148+
add_text(rspace) if rspace
149+
end
142150
when '#'
143151
n = code.count("\n") + (rspace ? 1 : 0)
144152
if trim && lspace && rspace
@@ -150,14 +158,6 @@ def initialize(input, properties={})
150158
end
151159
when '%'
152160
add_text("#{lspace}#{literal_prefix}#{code}#{tailch}#{literal_postfix}#{rspace}")
153-
when nil, '-'
154-
if trim && lspace && rspace
155-
add_code("#{lspace}#{code}#{rspace}")
156-
else
157-
add_text(lspace) if lspace
158-
add_code(code)
159-
add_text(rspace) if rspace
160-
end
161161
else
162162
handle(indicator, code, tailch, rspace, lspace)
163163
end

0 commit comments

Comments
 (0)