diff options
author | Jonas Smedegaard <dr@jones.dk> | 2024-09-02 19:17:50 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2024-09-02 19:18:02 +0200 |
commit | ff64660f1c1a86cff7ab90e559c12cc2c7c08124 (patch) | |
tree | 25bbc2375faba1e4929a6ece43acf3b50aa1b36c | |
parent | f55d6ec9427814b330da3079acf5ccb301e2723e (diff) |
encode LaTeX strings
-rwxr-xr-x | bin/events2semesterplan.pl | 8 |
1 files 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; |