As a result of the commit from the parent issue, slides with a blank alt attribute in the thumbnail navigation will not appear. This is because the regex looks for one or more characters in the alt attribute, and if it's empty then it thinks the rest of the img tag until the next set of quotes is the alt text, causing incorrect HTML to be displayed (or rather, not displayed).
Here's an example of the issue for the following images (first works, second doesn't):
<img src="[SNIP]/files/styles/flexslider_full/public/images/canopycreekautumn.jpg" alt="sdf" title="sdf">
$attributes['data-thumb-alt'] = sdf
HTML output: <li data-thumb="[SNIP]/files/styles/flexslider_full/public/images/canopycreekautumn.jpg" data-thumb-alt="sdf"><img src="[SNIP]/files/styles/flexslider_full/public/images/canopycreekautumn.jpg" width="800" height="500" alt="sdf" title="sdf" /></li>
<img src="[SNIP]/files/styles/flexslider_full/public/images/calm_0.jpg" alt="" title="">
$attributes['data-thumb-alt'] = " title=
HTML output: <li data-thumb="[SNIP]/files/styles/flexslider_full/public/images/calm_0.jpg" data-thumb-alt="" title="><img src="[SNIP]/files/styles/flexslider_full/public/images/calm_0.jpg" width="800" height="500" alt="" title="" /></li>
The fix is to replace the + with an * in the alt regex.
Comment | File | Size | Author |
---|---|---|---|
#6 | flexslider-fix_alt_regex-2837171-6.patch | 602 bytes | kyberman |
#2 | fix_alt_regex-2837171-2.patch | 589 bytes | BWPanda |
|
Comments
Comment #2
BWPanda CreditAttribution: BWPanda commentedComment #4
amaria CreditAttribution: amaria commentedNice catch again! Committed. Thanks!
Comment #6
kybermanThe same problem is inside current D8 version, thanks @BWPanda for simple patch.
Attaching almost identical patch for 8.x-2.0-beta1 and 8.x-2.x-dev, please reopen and merge, thank you.
Comment #7
tacituseu CreditAttribution: tacituseu commentedConfirming on 8.x-2.0-beta1.
@kyberman: Please file a new issue for 8.x-2.x-dev otherwise this wont be noticed.