From: William Morgan Date: Thu, 17 Jan 2008 01:18:54 +0000 (-0800) Subject: more quote detection tweaking X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=58d450d507300e6fe76370009298bad4ebde409c;p=sup more quote detection tweaking --- diff --git a/lib/sup/message.rb b/lib/sup/message.rb index c487ae3..ef5e3d1 100644 --- a/lib/sup/message.rb +++ b/lib/sup/message.rb @@ -29,7 +29,7 @@ class Message QUOTE_PATTERN = /^\s{0,4}[>|\}]/ BLOCK_QUOTE_PATTERN = /^-----\s*Original Message\s*----+$/ - QUOTE_START_PATTERN = /\w/ + QUOTE_START_PATTERN = /\w.*:$/ SIG_PATTERN = /(^-- ?$)|(^\s*----------+\s*$)|(^\s*_________+\s*$)|(^\s*--~--~-)|(^\s*--\+\+\*\*==)/ MAX_SIG_DISTANCE = 15 # lines from the end @@ -420,7 +420,7 @@ private when :text newstate = nil - if line =~ QUOTE_START_PATTERN && nextline =~ QUOTE_PATTERN + if line =~ QUOTE_PATTERN || (line =~ QUOTE_START_PATTERN && nextline =~ QUOTE_PATTERN) newstate = :quote elsif line =~ SIG_PATTERN && (lines.length - i) < MAX_SIG_DISTANCE newstate = :sig