mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-09 06:35:37 +08:00
Merge pull request #8629 from artoscinote/ma_SCI_12101
Normalize legacy experiment descriptions in serializer [SCI-12101]
This commit is contained in:
commit
3a4a8cc6b8
1 changed files with 9 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue