Special characters in alt text break Picturefill method
-
Jordy, you probably remember my post recently about special characters. As I mentioned, I fixed that by stripping tags and escaping special characters.
$alt = esc_attr( strip_tags( $alt ) );
That works for standard special characters. Unfortunately, it doesn’t work for Latin characters with diacritic marks (āéǐòǖ) or Chinese characters (中文), both of which are used extensively on my site. The presence of those characters in an
<img>
alt attribute breaks the Picturefill method.Examples that break Picturefill…
<img src="http://www.theharbiner.com/media/2014/07/-e6-9d-8e-e6-98-b1-e6-98-8e-900x675.jpg" alt="李昱明">
Note: That number string is how “Media File Renamer” automatically renamed the image with a title that used Chinese characters (李昱明). Messy.
<img src="http://www.theharbiner.com/media/2014/07/cafe-bu-bu.jpg.jpg" alt="Café Bubu">
Anyway, it’s probably a bug with Picturefill and not your plugin. Hoping they’ll release a fix soon.
- The topic ‘Special characters in alt text break Picturefill method’ is closed to new replies.