Theming URL output in UrlEmbedFilter

Created on 1 March 2022, over 2 years ago
Updated 30 May 2024, 28 days ago

Problem/Motivation

HTML generated by UrlEmbedFilter is inserted as is received from the external source. While there's nothing semantically or technically wrong with having an <IFRAME> element next to <P> elements, it would be useful to have more control of the generated output by wrapping it inside another <DIV> element and throwing a few attributes to it (like CSS classes). I think it would be welcomed to have a few standard and predictable CSS selectors to style every kind of embedded content.

This also would facilitate implementing other features like Add option to make embeds responsive ✨ Add option to make embeds responsive Needs work (and others similar) as only a few lines of CSS targeting the wrapper element would be necessary.

Proposed resolution

Add a theming function inside UrlEmbedFilter::process() to wrap the output generated by the external source inside a <DIV> element.

Remaining tasks

Discuss the convenience of this approach and review a patch.

User interface changes

None.

API changes

None (I think).

Data model changes

None.

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024