Merge pull request #8629 from artoscinote/ma_SCI_12101

Normalize legacy experiment descriptions in serializer [SCI-12101]
This commit is contained in:
Martin Artnik 2025-07-03 14:29:41 +02:00 committed by GitHub
commit 3a4a8cc6b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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)