Problem/Motivation

I write markdown articles, and I choose my view mode depending upon the image, hence I need to specify the data-view-mode attribute on the <drupal-media/> tag.

Steps to reproduce

Add a <drupal-media data-view-mode="my-media-view-mode"/> tag in markdown content. View mode is discarded and some default applies instead.

Proposed resolution

Simply add 'data-entity-uuid' => TRUE, in the src/Plugin/Markdown/AllowedHtml/MediaEmbed.php file.

Remaining tasks

Add 'data-entity-uuid' => TRUE, in the src/Plugin/Markdown/AllowedHtml/MediaEmbed.php file.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork markdown-3418345

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pounard created an issue. See original summary.

pounard’s picture

Issue summary: View changes
pounard’s picture

Issue summary: View changes
pounard’s picture

Please know that, for anybody experiencing this issue reaching this page that you can work around this by adding: <drupal-media data-align data-caption data-entity-type data-entity-uuid data-view-mode> in the allowed custom HTML configuration field in your filter format configuration UI.

joelpittet made their first commit to this issue’s fork.

joelpittet’s picture

Status: Active » Needs review

@pounard This isn't getting much traction but I can't see why we can't add this. Could you have a peak at the MR to see if it does the trick?

joelpittet’s picture

Category: Bug report » Feature request

I just added it, I guess if something else is needed we can open up a new one. Thanks for suggesting this feature @pounard.

joelpittet’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • joelpittet committed 93e51b82 on 3.0.x
    feat: #3418345 data-view-mode attribute is missing from the MediaEmbed...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.