From b42fa9f7364d99aeea4d98ef3300537292489002 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 8 Nov 2022 20:19:24 -0300 Subject: [PATCH 1/3] fix: permitir guardar br sutty/editor#61 --- app/models/metadata_template.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/metadata_template.rb b/app/models/metadata_template.rb index 6a86d45a..709c87c3 100644 --- a/app/models/metadata_template.rb +++ b/app/models/metadata_template.rb @@ -203,7 +203,7 @@ MetadataTemplate = Struct.new(:site, :document, :name, :label, :type, def allowed_tags @allowed_tags ||= %w[strong em del u mark p h1 h2 h3 h4 h5 h6 ul ol li img iframe audio video div figure blockquote - figcaption a sub sup small table thead tbody tfoot tr th td].freeze + figcaption a sub sup small table thead tbody tfoot tr th td br].freeze end # Decifra el valor From fd855a1e93be4d39220cebdaf8a4612ffef2293a Mon Sep 17 00:00:00 2001 From: f Date: Tue, 8 Nov 2022 20:19:53 -0300 Subject: [PATCH 2/3] fix: ajustes para el contenido #8395 --- app/assets/stylesheets/application.scss | 29 +++++++++++++++++++++++++ app/views/posts/show.haml | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 649c272d..818ebbd5 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -515,3 +515,32 @@ $bezier: cubic-bezier(0.75, 0, 0.25, 1); } } } + +.content { + p { min-height: $font-size-base * $line-height-base; } + h1 { min-height: $h1-font-size * $headings-line-height; } + h2 { min-height: $h2-font-size * $headings-line-height; } + h3 { min-height: $h3-font-size * $headings-line-height; } + h4 { min-height: $h4-font-size * $headings-line-height; } + h5 { min-height: $h5-font-size * $headings-line-height; } + h6 { min-height: $h6-font-size * $headings-line-height; } + + iframe { border: 0; } + + audio { width: 100%; } + + img, + video, + iframe { + @extend .img-fluid; + height: auto; + } + + & > * { + margin-bottom: 1rem; + + &:last-child { + margin-bottom: 0; + } + } +} diff --git a/app/views/posts/show.haml b/app/views/posts/show.haml index e46114af..da3dd16a 100644 --- a/app/views/posts/show.haml +++ b/app/views/posts/show.haml @@ -37,5 +37,5 @@ - next if metadata.front_matter? - cache [metadata, I18n.locale] do - %section.editor{ id: attr, dir: dir } + %section.content.pb-3{ id: attr, dir: dir } = @post.public_send(attr).value.html_safe From d8a20be0b6a9d7283242962ebca2db048b9ef512 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 9 Nov 2022 13:01:12 -0300 Subject: [PATCH 3/3] fix: dar el mismo estilo al editor nuevo --- app/views/posts/attributes/_new_content.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/posts/attributes/_new_content.haml b/app/views/posts/attributes/_new_content.haml index 34fc4e60..520daff8 100644 --- a/app/views/posts/attributes/_new_content.haml +++ b/app/views/posts/attributes/_new_content.haml @@ -3,7 +3,7 @@ = render 'posts/attribute_feedback', post: post, attribute: attribute, metadata: metadata - .new-editor{ id: attribute } + .new-editor.content{ id: attribute } = text_area_tag "#{base}[#{attribute}]", metadata.value.html_safe, dir: dir, lang: locale, **field_options(attribute, metadata), class: 'd-none'