mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-09 03:20:21 +00:00
We used to use <p> to seperate block between them. now use <div>
trix doesn't allow the use of `<p>` as block separator since it can not contain `<figure>`: use `<div>` and _emulate_ as `<p>` with margin bottom
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
class TrixScrubber < Rails::Html::PermitScrubber
|
||||
ALLOWED_TAGS = ["p", "b", "strong", "em", "i", "a", "u", "br", "del", "h1", "blockquote", "pre",
|
||||
"ul", "ol", "li"].freeze
|
||||
"ul", "ol", "li", "div"].freeze
|
||||
ALLOWED_ATTRIBUTES = ["href", "target", "src", "alt"].freeze
|
||||
|
||||
def initialize
|
||||
|
||||
@@ -15,6 +15,10 @@ trix-editor {
|
||||
color: #9fc820; // Equivalent to text-angular a
|
||||
}
|
||||
|
||||
div {
|
||||
margin-bottom: 1.5rem; // Equivalent to text-angular p (trix doesn't use p as default one, since we could not include figures inside p)
|
||||
}
|
||||
|
||||
// Copy/pasted from _type.scss
|
||||
blockquote {
|
||||
line-height: 1.6;
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
.product-description {
|
||||
margin: 1rem 0.25rem 0.25rem 0;
|
||||
|
||||
.text-small div {
|
||||
margin-bottom: 1.5rem; // Equivalent to p (trix doesn't use p as separator by default, so emulate div as p to be backward compatible)
|
||||
}
|
||||
}
|
||||
|
||||
.property-selectors li {
|
||||
|
||||
@@ -158,6 +158,10 @@
|
||||
// line-clamp is not supported in Safari
|
||||
line-height: 1rem;
|
||||
height: 1.75rem;
|
||||
|
||||
> div {
|
||||
margin-bottom: 1.5rem; // Equivalent to p (trix doesn't use p as separator by default, so emulate div as p to be backward compatible)
|
||||
}
|
||||
}
|
||||
|
||||
.product-properties {
|
||||
|
||||
Reference in New Issue
Block a user