data-align should work without caption

Created on 1 June 2019, over 5 years ago
Updated 9 July 2024, 6 months ago

This is a follow up issue to #2645458: data-align and data-caption don't work with entity_embed β†’ .

It seems data-align doesn't work without a caption. If you want to have your embed to the right of a paragraph, but no caption, this is currently broken.

πŸ› Bug report
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States oknate Greater New York City Area

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.

  • πŸ‡ΊπŸ‡ΈUnited States tlwatson

    To anyone still coming across this... I was able to fix the problem by reordering my "filter processing order".

    Specifically, if you have "Limit allowed HTML tags and correct faulty HTML" enabled, then it must come before "Align images" and "Caption images". Looking at the filter details, I think the problem is that the IMG element allows all the needed "data-" attributes for align/caption, but does not allow the "class" attribute. So you don't want to convert the data- attributes to classes and then get them stripped out.

    If for some reason you have to bypass this instead of reordering you could probably add to your manually editable tags, but I doubt that's right for most scenarios. If you have any other data-* filters to process, they should probably go after the HTML filter too.

Production build 0.71.5 2024