]> git.cworth.org Git - sup/commitdiff
loosen up quote header matching
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Wed, 16 Jan 2008 22:07:09 +0000 (14:07 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Wed, 16 Jan 2008 22:10:37 +0000 (14:10 -0800)
Don't try and parse all possible quote headers, just assume that they're
at least one word character followed by some quoted lines of text.

lib/sup/message.rb

index bd371628fb8045b1fc31cb529d5eb3ed0daf5d62..85e2760cea1ab20fa4d263ed0c93830268c1bc52 100644 (file)
@@ -29,7 +29,7 @@ class Message
 
   QUOTE_PATTERN = /^\s{0,4}[>|\}]/
   BLOCK_QUOTE_PATTERN = /^-----\s*Original Message\s*----+$/
-  QUOTE_START_PATTERN = /(^\s*Excerpts from)|(^\s*In message )|(^\s*In article )|(^\s*Quoting )|((wrote|writes|said|says)\s*:\s*$)/
+  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_PATTERN || (line =~ QUOTE_START_PATTERN && (nextline =~ QUOTE_PATTERN || nextline =~ QUOTE_START_PATTERN))
+        if line =~ QUOTE_START_PATTERN && nextline =~ QUOTE_PATTERN
           newstate = :quote
         elsif line =~ SIG_PATTERN && (lines.length - i) < MAX_SIG_DISTANCE
           newstate = :sig