aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-08-31 14:10:16 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-08-31 14:11:51 +0100
commit02b907f535d7166aceeb2f3fb17b9b2e6cb64e72 (patch)
tree240e512475ca395c10e9fe9d6f61f1de0b888be1
parent0ca53384fe8e693d8d246e2b32b30695fd14200f (diff)
Convert all single newlines, not only first.
-rw-r--r--CHANGELOG.md1
-rw-r--r--perllib/FixMyStreet/Template.pm2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1892c5bec..83ca091b7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,6 +34,7 @@
- Allow questionnaire link to be revisited in quick succession. #2123
- Update Google Maps directions link.
- Fix inspector pin dragging. #2073.
+ - Maintain all single newlines in text output, not only the first.
- Open311 improvements:
- CLOSED status maps to 'closed' state if extended statuses are enabled.
- Don't generate template comment text on move between fixed states.
diff --git a/perllib/FixMyStreet/Template.pm b/perllib/FixMyStreet/Template.pm
index 4a9cffecb..9c565114b 100644
--- a/perllib/FixMyStreet/Template.pm
+++ b/perllib/FixMyStreet/Template.pm
@@ -114,7 +114,7 @@ into <br>s too.
sub html_paragraph : Filter('html_para') {
my $text = shift;
my @paras = split(/(?:\r?\n){2,}/, $text);
- s/\r?\n/<br>\n/ for @paras;
+ s/\r?\n/<br>\n/g for @paras;
$text = "<p>\n" . join("\n</p>\n\n<p>\n", @paras) . "</p>\n";
return $text;
}