2020-05-26 22:26:19 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-06-09 14:28:18 +00:00
|
|
|
# Contenido con el editor de Markdown
|
2020-06-25 19:29:14 +00:00
|
|
|
class MetadataMarkdownContent < MetadataContent
|
|
|
|
# Renderizar a HTML y sanitizar
|
|
|
|
def to_s
|
|
|
|
sanitize CommonMarker.render_doc(value, %i[FOOTNOTES SMART],
|
|
|
|
%i[table strikethrough autolink]).to_html
|
|
|
|
end
|
|
|
|
|
|
|
|
# XXX: No sanitizamos acá porque se escapan varios símbolos de
|
|
|
|
# markdown y se eliminan autolinks. Mejor es habilitar la generación
|
|
|
|
# SAFE de CommonMark en la configuración del sitio.
|
|
|
|
def sanitize(string)
|
|
|
|
string
|
2020-06-09 14:28:18 +00:00
|
|
|
end
|
2020-05-26 22:26:19 +00:00
|
|
|
end
|