]> git.cworth.org Git - sup/commitdiff
more quote detection tweaking
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Thu, 17 Jan 2008 01:18:54 +0000 (17:18 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Thu, 17 Jan 2008 01:18:54 +0000 (17:18 -0800)
lib/sup/message.rb

index c487ae35763902f6b847f789942e52c640d82fcf..ef5e3d1e208b90544ea47625598e4da85a137b8b 100644 (file)
@@ -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