Comments

mstrelan created an issue. See original summary.

dww’s picture

StatusFileSize
new2.43 KB

Thanks for the issue, patch, and including test coverage for the change! This makes sense to me. If we support <img> src attributes, we should handle srcset, too (now that it exists!).

Here's a re-roll for modern 8.x-1.x branch.

I'll try to get this in before the next release. Just don't want to make trouble for #2418369: Internal URL handling (language prefixes, base://, ...) which is a bigger fish to fry...

  • dww committed 75a7ced on 8.x-1.x authored by mstrelan
    Issue #2993935 by mstrelan, dww: Support for srcset attribute
    
dww’s picture

Status: Needs review » Fixed

Upon further review, this isn't going to conflict with #2418369: Internal URL handling (language prefixes, base://, ...), so let's get this in. Committed and pushed to 8.x-1.x.

Thanks @mstrelan!

Status: Fixed » Closed (fixed)

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

dippers’s picture

This patch seems to introduce a problem where responsive images are handled using a simple img tag and extended srcset attribute. Drupal's core responsive image module will output image tags of this type if "there is only one source tag with an empty media attribute".

A srcset on an image tag will be of the form srcset="elva-fairy-320w.jpg, elva-fairy-480w.jpg 1.5x, elva-fairy-640w.jpg 2x". Since pathologic treats srcset the same as any other url attribute it does not handle the case of multiple sources or sizes. In this case pathologic converts the first url and then treats the rest of the string as a url parameter and encodes as such.

Since Drupal generates img srcsets it is really necessary for Pathologic to deal with them.