aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/incoming_message.rb14
-rw-r--r--todo.txt13
2 files changed, 18 insertions, 9 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 17a5844bb..d009fdd2e 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -17,7 +17,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: incoming_message.rb,v 1.83 2008-04-21 14:45:06 francis Exp $
+# $Id: incoming_message.rb,v 1.84 2008-04-21 15:00:57 francis Exp $
# TODO
# Move some of the (e.g. quoting) functions here into rblib, as they feel
@@ -201,7 +201,17 @@ class IncomingMessage < ActiveRecord::Base
# XXX and this FOLDED_QUOTED_SECTION stuff is a mess
def self.remove_quoted_sections(text, replacement = "FOLDED_QUOTED_SECTION")
text = text.dup
-
+
+ # First do this peculiar form of quoting, as the > single line quoting
+ # further below messes with it. Note the carriage return where it wraps -
+ # this can happen anywhere according to length of the name/email. e.g.
+ # >>> D K Elwell <[email address]> 17/03/2008
+ # 01:51:50 >>>
+ # http://www.whatdotheyknow.com/request/71/response/108
+ # http://www.whatdotheyknow.com/request/police_powers_to_inform_car_insu
+ multiline_original_message = '(' + '''>>>.* \d\d/\d\d/\d\d\d\d\s+\d\d:\d\d:\d\d\s+>>>''' + ')'
+ text.gsub!(/^(#{multiline_original_message}\n.*)$/ms, replacement)
+
# Single line sections
text.gsub!(/^(>.*\n)/, replacement)
text.gsub!(/^(On .+ (wrote|said):\n)/, replacement)
diff --git a/todo.txt b/todo.txt
index ac4df9519..1a1e2770a 100644
--- a/todo.txt
+++ b/todo.txt
@@ -196,14 +196,13 @@ Quoting fixing TODO:
http://www.whatdotheyknow.com/request/sale_of_public_land_in_worcester
http://www.whatdotheyknow.com/request/148/response/209
http://www.whatdotheyknow.com/request/35/response/191
-Char encoding and other bad formatting:
- http://www.whatdotheyknow.com/request/107/response/144
- http://www.whatdotheyknow.com/request/35/response/177
- http://www.whatdotheyknow.com/request/52/response/238
-
- http://localhost:3001/request/107/response/144
- http://localhost:3001/request/52/response/238
+ http://localhost:3001/request/64/response/102
+ http://localhost:3001/request/55/response/96
+ http://localhost:3001/request/71/response/108
+ http://localhost:3001/request/police_powers_to_inform_car_insu
+ http://localhost:3001/request/30/response/166
+
Sources of public bodies
========================