Problem/Motivation

There are a number of scenarios where source HTML is modified in unwanted ways:

  • Text that has links wrapping images, the content looses the links.
  • Tags that wrap media, which are repeated later in the same line, are repositioned or repeated later in the same line.

Steps to reproduce

Example 1:

<p><a href="/somewhere">[[{"fid":"123","view_mode":"default","fields":{"format":"default","alignment":""},"link_text":null,"type":"media","field_deltas":{"37":{"format":"default","alignment":""}},"attributes":{}}]]</a> <strong>Something</strong></p>

becomes:

<drupal-media ...></drupal-media>
<p><strong>Something</strong></p>

Example 2:

<p><a href="/somewhere">[[{"fid":"123","view_mode":"default","fields":{"format":"default","alignment":""},"link_text":null,"type":"media","field_deltas":{"37":{"format":"default","alignment":""}},"attributes":{}}]]</a> <strong><a href="/somewhere">Something</a>:</strong></p>

becomes:

<p><a href="/somewhere"></a></p>
<drupal-media ...></drupal-media>
<p><strong>Something:</strong></p>

Proposed resolution

Fix the migrations so that only [[{}]] media tags and img tags are modified, all other HTML is left as-is.

Remaining tasks

Fix the migrations so that only [[{}]] media tags and img tags are modified, all other HTML is left as-is.

API changes

TBD

Comments

damienmckenna created an issue. See original summary.

damienmckenna’s picture

There's a bigger problem here where the HTML can be mucked up by the conversion process.

damienmckenna’s picture

Issue tags: +Needs tests
damienmckenna’s picture

Title: HTML with links wrapping images loose the links when migrated » Unwanted modifications to HTML
Issue summary: View changes
damienmckenna’s picture

Title: Unwanted modifications to HTML » Unwanted modifications to HTML by MediaWysiwygFilter
Issue summary: View changes
damienmckenna’s picture

Issue summary: View changes
damienmckenna’s picture

Issue summary: View changes