From b9dc7c16adfeda4bbc1c9ab1b2deede0be737b67 Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Wed, 28 Aug 2024 13:09:18 -0400 Subject: [PATCH] Use /s modifier on regex. --- rem2html/rem2html.in | 10 +++++----- rem2pdf/lib/Remind/PDF/Entry.pm | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rem2html/rem2html.in b/rem2html/rem2html.in index 5d93c28d..c1fba480 100644 --- a/rem2html/rem2html.in +++ b/rem2html/rem2html.in @@ -374,7 +374,7 @@ sub parse_input ($1 % 256), ($1 % 256), ($1 % 256)); } } elsif ($special eq 'COLOR' || $special eq 'COLOUR') { - if ($body =~ /(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/) { + if ($body =~ /(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/s) { my($r, $g, $b, $text) = ($1, $2, $3, $4); my $color = sprintf("style=\"color: #%02X%02X%02X;\"", $r % 256, $g % 256, $b % 256); @@ -392,13 +392,13 @@ sub fix_whitespace my ($text) = @_; # Collapse multiple spaces/tabs to a single space - $text =~ s/[ \t]+/ /g; + $text =~ s/[ \t]+/ /gs; # Remove whitespace before/after newlines - $text =~ s/\s+\n/\n/g; - $text =~ s/\n\s+/\n/g; + $text =~ s/\s+\n/\n/gs; + $text =~ s/\n\s+/\n/gs; # Collapse multiple newlines to a single newline - $text =~ s/\n+/\n/g; + $text =~ s/\n+/\n/gs; # Convert newlines to
$text =~ s|\n|
|g; diff --git a/rem2pdf/lib/Remind/PDF/Entry.pm b/rem2pdf/lib/Remind/PDF/Entry.pm index a746c7a7..d988621a 100644 --- a/rem2pdf/lib/Remind/PDF/Entry.pm +++ b/rem2pdf/lib/Remind/PDF/Entry.pm @@ -89,13 +89,13 @@ sub render # Clean up the body: # Collapse multiple spaces/tabs to a single space - $body =~ s/[ \t]+/ /g; + $body =~ s/[ \t]+/ /gs; # Remove whitespace before/after newlines - $body =~ s/\s+\n/\n/g; - $body =~ s/\n\s+/\n/g; + $body =~ s/\s+\n/\n/gs; + $body =~ s/\n\s+/\n/gs; # Collapse multiple newlines to a single newline - $body =~ s/\n+/\n/g; + $body =~ s/\n+/\n/gs; $layout->set_text(Encode::decode('UTF-8', $body)); my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . $settings->{entry_size} . 'px');