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-05-26 22:26:19 +00:00
|
|
|
class MetadataMarkdownContent < MetadataContent
|
|
|
|
# Renderizar a HTML
|
|
|
|
def to_s
|
|
|
|
CommonMarker.render_doc(value, %i[FOOTNOTES SMART],
|
|
|
|
%i[table strikethrough autolink]).to_html
|
|
|
|
end
|
2020-06-09 14:28:18 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
end
|
2020-05-26 22:26:19 +00:00
|
|
|
end
|