aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/View/Web.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/View/Web.pm')
-rw-r--r--perllib/FixMyStreet/App/View/Web.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/View/Web.pm b/perllib/FixMyStreet/App/View/Web.pm
index 9cc571efc..37a81e444 100644
--- a/perllib/FixMyStreet/App/View/Web.pm
+++ b/perllib/FixMyStreet/App/View/Web.pm
@@ -133,6 +133,9 @@ sub escape_js {
'>' => 'u003e',
);
$text =~ s/([\\"'<>])/\\$lookup{$1}/g;
+
+ $text =~ s/(?:\r\n|\n|\r)/\\n/g; # replace newlines
+
return $text;
}