How to only keep the first line of a Google Calendar event description

It looks like I have to create a custom component and make a replacement in /calendar/init.py, but I can’t quite figure out what to do.

I’m pretty sure the line I have to edit is:
self._cal_data[‘description’] = self.data.event.get(‘description’, ‘’)

Assuming your lines are “separated” with a carriage return, why don’t you create a template sensor that would extract the first line only instead of potentially breaking the code (and having to maintain it)?
{{states.calendar.[CALENDAR_NAME].attributes.description.splitlines()[0]}}

Unfortunately the state of attributes.description returns ‘unknown’, I think because the description contains URLs.

The calendar is one I subscribed to and I can’t edit the descriptions.

This sounds like a bug then, might worth raising an issue on github

Yep it seems like it. Bug report filed.