From 3a7ab15d2bf3452ed96b04ace9ea7f38ee9851fc Mon Sep 17 00:00:00 2001 From: f Date: Sat, 15 Aug 2020 11:58:28 -0300 Subject: [PATCH] eliminar retornos de carro --- app/models/metadata_markdown_content.rb | 2 +- app/models/metadata_template.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/metadata_markdown_content.rb b/app/models/metadata_markdown_content.rb index 509088db..50aaac16 100644 --- a/app/models/metadata_markdown_content.rb +++ b/app/models/metadata_markdown_content.rb @@ -12,6 +12,6 @@ class MetadataMarkdownContent < MetadataContent # markdown y se eliminan autolinks. Mejor es deshabilitar la # generaciĆ³n SAFE de CommonMark en la configuraciĆ³n del sitio. def sanitize(string) - string + string.tr("\r", '') end end diff --git a/app/models/metadata_template.rb b/app/models/metadata_template.rb index 6242f8f9..636ccfd2 100644 --- a/app/models/metadata_template.rb +++ b/app/models/metadata_template.rb @@ -99,7 +99,7 @@ MetadataTemplate = Struct.new(:site, :document, :name, :label, :type, return if string.nil? return string unless string.is_a? String - sanitizer.sanitize(string, + sanitizer.sanitize(string.tr("\r", ''), tags: allowed_tags, attributes: allowed_attributes + %w[data-trix-attachment], scrubber: scrubber).strip.html_safe