az-digital / az_quickstart

UArizona's web content management system built with Drupal 10.
https://quickstart.arizona.edu
GNU General Public License v2.0
30 stars 20 forks source link

Standard text formatter is converting line breaks into HTML on embedded entities (media) breaking embedded media HTML. #3689

Open trackleft opened 1 week ago

trackleft commented 1 week ago

Problem/Motivation

I'm seeing weird space in embedded media.

Describe the bug

The current filter processing order is this.

image

In practice, this means that the rendered media is processed, which is not desireable.

To Reproduce

Steps to reproduce the behavior:

Create a media image. Add caption and credit Embed that media image in a text area using the az_standard text format. See extra spaces in the caption area.

image image

Proposed resolution

Change the filter processing order so that embedded content is added last.

image

Expected behavior

Media should be embedable without being altered by the text formatter.

bberndt-uaz commented 1 week ago

With a local 2.11.1 build, I tested switching the order of Embed media and Convert line breaks into HTML (i.e. <br> and <p>) and unfortunately this solution appears to break linked images.

bberndt-uaz commented 1 week ago

Regarding linked images, here are some related drupal.org issues as found by @joeparsons in a comment on Embedding any block in a text paragraph breaks linked images #3569:

Possibly related Drupal core/contrib issues: