diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 2cad7f80..dc61b5d3 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -516,3 +516,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/models/metadata_template.rb b/app/models/metadata_template.rb index 1cb1163e..c03c3ba8 100644 --- a/app/models/metadata_template.rb +++ b/app/models/metadata_template.rb @@ -207,7 +207,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 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' diff --git a/app/views/posts/show.haml b/app/views/posts/show.haml index f2352f27..4daa5cfd 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