mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Clean up whitespace runs in rem2pdf.
All checks were successful
Remind unit tests / tests (push) Successful in 45s
All checks were successful
Remind unit tests / tests (push) Successful in 45s
This commit is contained in:
@@ -85,6 +85,19 @@ sub render
|
||||
} else {
|
||||
$body = $self->{body};
|
||||
}
|
||||
|
||||
# Clean up the body:
|
||||
|
||||
# Collapse multiple spaces/tabs to a single space
|
||||
$body =~ s/[ \t]+/ /g;
|
||||
|
||||
# Collapse multiple newlines to a single newline
|
||||
$body =~ s/\n+/\n/g;
|
||||
|
||||
# Remove whitespace before/after newlines
|
||||
$body =~ s/\s+\n/\n/g;
|
||||
$body =~ s/\n\s+/\n/g;
|
||||
|
||||
$layout->set_text(Encode::decode('UTF-8', $body));
|
||||
my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . $settings->{entry_size} . 'px');
|
||||
$layout->set_font_description($desc);
|
||||
|
||||
Reference in New Issue
Block a user