mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-25 13:56:21 +00:00
eb7d0679bb
en castellano no nos afectó pero en árabe rompe el significado
24 lines
459 B
Ruby
24 lines
459 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Un campo de texto
|
|
class MetadataString < MetadataTemplate
|
|
# Una string vacía
|
|
def default_value
|
|
super || ''
|
|
end
|
|
|
|
def indexable?
|
|
true && !private?
|
|
end
|
|
|
|
private
|
|
|
|
# No se permite HTML en las strings
|
|
def sanitize(string)
|
|
return '' if string.blank?
|
|
|
|
sanitizer.sanitize(string.strip.unicode_normalize,
|
|
tags: [],
|
|
attributes: []).strip.html_safe
|
|
end
|
|
end
|