sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit f3671fb0ad7082e52f3f96f8812a0d6fb1e35a9e
parent 2f4d892aaa51da20df9ebaaea24401e71d826321
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Wed, 16 Jan 2008 14:07:09 -0800

loosen up quote header matching

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.

Diffstat:
M lib/sup/message.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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 = /(^\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