Carousel description wrapper invalid syntax

Created on 28 October 2024, 3 months ago

Problem/Motivation

In the template for the carousel the description is currently wrapped in a paragraph tag.
<p>{{ row.description }}</p>
However this is only valid with a small subset of HTML tags (a, em, strong, etc). If the description contains a formatted body then it is nesting paragraph tags. This results in invalid syntax which is typically corrected by the browser by closing the parent paragraph tag before starting another one. And the closing paragraph tag is corrected by adding an opening tag.

So if you have a description which contains <p>some description</p> the result is

<p></p>
<p>some description</p>
<p><p/>

And if your paragraph tags have the default styling of a bottom margin that means there is extra space above and below the description, causing the caption to take up more space than is necessary.

Steps to reproduce

Create a carousel with captions enabled. Set the body field of the node as a description. Create some content in that body field.

Proposed resolution

Enclose it with a div tag instead of a paragraph tag. Add a class to the div tag so it's easier to style should users want to add margin or padding to the description container.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

5.5

Component

Carousel

Created by

πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024