fix(export): fix iCalendar export description HTML conversion

Paragraphs and line breaks are now properly handled when converting from HTML to text

Closes #888

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-11-21 15:40:34 +01:00
parent b97f1c997f
commit d7daafc4ea
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -8,7 +8,7 @@ defmodule Mobilizon.Service.Export.ICalendar do
alias Mobilizon.{Config, Events}
alias Mobilizon.Events.{Event, EventOptions}
alias Mobilizon.Service.Export.{Cachable, Common}
alias Mobilizon.Service.Formatter.HTML
alias Mobilizon.Service.Formatter.{HTML, Text}
@behaviour Cachable
@ -124,7 +124,7 @@ defmodule Mobilizon.Service.Export.ICalendar do
dtstart: begins_on(event),
dtstamp: event.publish_at || DateTime.utc_now(),
dtend: ends_on(event),
description: HTML.strip_tags(event.description),
description: HTML.html_to_text(event.description),
uid: event.uuid,
url: event.url,
status: event.status,