aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/Utils.pm2
-rw-r--r--t/app/controller/report_new.t6
-rw-r--r--t/app/controller/report_updates.t4
3 files changed, 6 insertions, 6 deletions
diff --git a/perllib/Utils.pm b/perllib/Utils.pm
index 39c251876..c9afff186 100644
--- a/perllib/Utils.pm
+++ b/perllib/Utils.pm
@@ -197,7 +197,7 @@ sub cleanup_text {
}
# Remove unneeded whitespace
- my @lines = grep { m/\S/ } split m/\n\n/, $input;
+ my @lines = grep { m/\S/ } split m/(?:\r?\n){2,}/, $input;
for (@lines) {
$_ = trim_text($_);
$_ = ucfirst $_; # start with capital
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index f06c23501..fa188210a 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -151,8 +151,8 @@ foreach my $test (
msg => 'title and details tidied up',
pc => 'SW1A 1AA',
fields => {
- title => 'DOG SHIT ON WALLS',
- detail => 'on this portakabin - more of a portaloo HEH!!',
+ title => "DOG SHIT\r\nON WALLS",
+ detail => "on this portakabin -\r\n\r\nmore of a portaloo HEH!!",
photo => '',
name => 'Bob Jones',
may_show_name => '1',
@@ -166,7 +166,7 @@ foreach my $test (
changes => {
title => 'Dog poo on walls',
detail =>
- 'On this [portable cabin] - more of a [portable loo] HEH!!',
+ "On this [portable cabin] -\n\nMore of a [portable loo] HEH!!",
},
errors => [ 'Please enter your email', ],
},
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index 3076a4564..856e7d763 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -324,13 +324,13 @@ for my $test (
form_values => {
submit_update => 1,
rznvy => 'unregistered@example.com',
- update => 'update from an unregistered user',
+ update => "update from an\r\n\r\nunregistered user",
add_alert => 1,
name => 'Unreg User',
may_show_name => undef,
},
changes => {
- update => 'Update from an unregistered user',
+ update => "Update from an\n\nUnregistered user",
},
}
) {