Normalize legacy experiment descriptions in serializer [SCI-12101]

This commit is contained in:
Martin Artnik 2025-07-03 13:40:03 +02:00
parent 6ca73738be
commit 894abb4999

View file

@ -15,9 +15,17 @@ module Lists
I18n.l(object.created_at, format: :full_date)
end
# normalize description to handle legacy description newlines
def description
# if description includes HTML, it is already in the new format.
return object.description if object.description.match?(/<(.|\n)*?>/)
simple_format(object.description)
end
def sa_description
@user = scope[:user] || @instance_options[:user]
custom_auto_link(object.description,
custom_auto_link(description,
simple_format: false,
tags: %w(img),
team: object.project.team)