Closed stooit closed 5 years ago
This problem is due to the Symfony lib versions used to ensure compatibility with Drupal in GovCMS.
Specifically, it appears to be an issue with the html5 parser that rewrites the HTML as attribute names only for attributes with empty values. One work around is to force the old behaviour to use the native DOMDocument (which was the only parser available in earlier versions anyway). I have quickly tested this and it builds the embed snippet correctly for the case above.
Describe the bug When media processor encounters an attribute with no value (e.g title in
<img title src="/path/to/image.jpg">
it fails to correctly replace the image with an embed snippet.This is because the
str_replace
insrc/Processor/Media.php
is trying to match on markup that is "sanitised", e.g "<img title="" src="/path/to/image.jpg">
so no match is found.Sample configuration
Expected behavior The first image on the page (
mccormack.jpg
) should appear, but does not and is stripped.Screenshots
Additional context None