You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand it is because Google calendar (and maybe others) supports HTML tags in the description text of an event while iCalendar does not.
However, strip_tags removes all strings enclosed by <>. This means you cannot use any angle brackets in the description.
$ cat test.php<?phpuse Spatie\CalendarLinks\Generators\Ics;use Spatie\CalendarLinks\Link;require __DIR__ . '/vendor/autoload.php';$link = Link::create('title', new DateTime, new DateTime)->description('This is a <test description>.');$ics = new Ics([], ['format' => 'file']);echo $ics->generate($link), "\n";
$ php test.phpBEGIN:VCALENDARVERSION:2.0PRODID:Spatie calendar-linksBEGIN:VEVENTUID:e91d06b8ce3f5bbe3c7ea6ea83fdcbf0SUMMARY:titleDTSTAMP:20241118T070823ZDTSTART:20241118T070823ZDTEND:20241118T070823ZDESCRIPTION:This is a .END:VEVENTEND:VCALENDAR
Suggestion
I would appreciate if Ics class has an option to skip strip_tags, e.g. new Ics(['stripTags' => false]).
The text was updated successfully, but these errors were encountered:
What do you want to achieve?
Currently
Ics::generate()
callsstrip_tags
on the description text.calendar-links/src/Generators/Ics.php
Lines 65 to 67 in 1178fda
I understand it is because Google calendar (and maybe others) supports HTML tags in the description text of an event while iCalendar does not.
However,
strip_tags
removes all strings enclosed by<>
. This means you cannot use any angle brackets in the description.Suggestion
I would appreciate if
Ics
class has an option to skipstrip_tags
, e.g.new Ics(['stripTags' => false])
.The text was updated successfully, but these errors were encountered: