From ff64660f1c1a86cff7ab90e559c12cc2c7c08124 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 2 Sep 2024 19:17:50 +0200 Subject: encode LaTeX strings --- bin/events2semesterplan.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/events2semesterplan.pl b/bin/events2semesterplan.pl index 9d20957..2df85ad 100755 --- a/bin/events2semesterplan.pl +++ b/bin/events2semesterplan.pl @@ -32,6 +32,7 @@ use Text::Xslate; use POSIX qw(locale_h); # resolve LC_TIME use locale; use DateTime::TimeZone; +use LaTeX::Encode qw(latex_encode); use LaTeX::Driver; use Object::Groupware::DAV; @@ -148,10 +149,13 @@ my @events = $calendar->events($span); my %vars; #$vars{metadata} = $calendar->metadata(); -$vars{name} = $ARGS{title} || ''; +$vars{name} = latex_encode( $ARGS{title} ) || ''; for (@events) { next unless $_->summary; - push @{ $vars{events} }, $_; + push @{ $vars{events} }, { + start_date => $_->start_date, + summary => latex_encode( $_->summary ), + }; } my %tmpl; -- cgit v1.2.3