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
Comment #2
damienmckennaThere's a bigger problem here where the HTML can be mucked up by the conversion process.
Comment #3
damienmckennaComment #4
damienmckennaComment #5
damienmckennaComment #6
damienmckennaComment #7
damienmckennaComment #8
damienmckennaRelated: #3075527: _filter_autop() breaks links around the <drupal-media> tag