mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-14 18:01:42 +00:00
20 lines
395 B
Ruby
20 lines
395 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Un campo de texto
|
|
class MetadataString < MetadataTemplate
|
|
# Una string vacía
|
|
def default_value
|
|
super || ''
|
|
end
|
|
|
|
private
|
|
|
|
# No se permite HTML en las strings
|
|
def sanitize(string)
|
|
return '' if string.blank?
|
|
|
|
sanitizer.sanitize(string.strip,
|
|
tags: [],
|
|
attributes: []).strip.html_safe
|
|
end
|
|
end
|