-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement HTML description #225
Comments
Hi Markus, can you please merge / restore this feature? If needed, I can help you with some other things like documentation, test etc. |
Is this coming back? |
I looked into the code, and happily do a PR, but can't get my head around it. I'm assuming I would need to have the attribute $descriptionHTML below this line iCal/src/Domain/Entity/Event.php Line 30 in 30f7277
Then create the GET, SET and UNSET methods in there. Then in the eventFactory, have something like this
but built more like this
Again, this is a wild guess. :) |
Hey guys, I don't have time to create a pull request for this right now. But here is a little workaround that will rewrite the description as an HTML description. use Eluceo\iCal\Domain\Entity\Event;
use Eluceo\iCal\Presentation\Component;
use Eluceo\iCal\Presentation\Factory\EventFactory;
// Create a custom event factory that can be passed to the CalendarFactory
class CustomEventFactory extends EventFactory
{
public function createComponent(Event $event): Component
{
$description = $event->getDescription();
$event->unsetDescription();
$component = parent::createComponent($event);
return $component->withProperty(
new Component\Property(
'X-ALT-DESC',
new Component\Property\Value\TextValue($description),
[new Component\Property\Parameter('FMTTYPE', new Component\Property\Value\TextValue('text/html'))]
)
);
}
} Now you can create a // Pass a new instance of the CustomEventFactory to the CalendarFactory
$componentFactory = new CalendarFactory(new CustomEventFactory()); The |
See #55
The text was updated successfully, but these errors were encountered: