Skip to content

Commit 65c7e14

Browse files
committed
no need to count the line_levels anymore. dont care
1 parent b56f3a8 commit 65c7e14

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/email_reply_parser.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def scan_line(line)
113113

114114
# We're looking for leading `>`'s to see if this line is part of a
115115
# quoted Fragment.
116-
line_levels = line =~ /(>+)$/ ? $1.size : 0
116+
is_quoted = !!(line =~ /(>+)$/)
117117

118118
# Mark the current Fragment as a signature if the current line is empty
119119
# and the Fragment starts with a common signature indicator.
@@ -128,14 +128,14 @@ def scan_line(line)
128128
# reply header also counts as part of the quoted Fragment, even though
129129
# it doesn't start with `>`.
130130
if @fragment &&
131-
((@fragment.quoted? != line_levels.zero?) ||
131+
((@fragment.quoted? == is_quoted) ||
132132
(@fragment.quoted? && quote_header?(line)))
133133
@fragment.lines << line
134134

135135
# Otherwise, finish the fragment and start a new one.
136136
else
137137
finish_fragment
138-
@fragment = Fragment.new(!line_levels.zero?, line)
138+
@fragment = Fragment.new(is_quoted, line)
139139
end
140140
end
141141

0 commit comments

Comments
 (0)