Last modified: 2014-02-12 23:53:22 UTC
In non-beta when images are disabled images are replaced with a link and alt text like so (on Barack Obama article): <a href="/w/index.php/File:Official_portrait_of_Barack_Obama.jpg" class="image"><span class="mw-mf-image-replacement">[A portrait shot of Barack Obama, looking straight ahead. He has short black hair, and is wearing a dark navy blazer with a blue striped tie over a light blue collared shirt. In the background are two flags hanging from separate flagpoles: the American flag, and the flag of the Executive Office of the President.]</span></a> The api doesn't replace the images like this - it simply strips it altogether. The API should be consistent with the mobile site rendering.
This doesn't seem to be a problem with the API but rather MobileFormatter. To be exact go to http://en.m.wikipedia.org/wiki/Barack_Obama#section_1 see "Obama with his half-sister" - disable images - boom - that disappears completely
parseItemsToRemove() adds these to the removals list... if ( $this->removeImages ) { $removals['TAG'][] = "img"; $removals['TAG'][] = "audio"; $removals['TAG'][] = "video"; $removals['CLASS'][] = "thumb tright"; $removals['CLASS'][] = "thumb tleft"; $removals['CLASS'][] = "thumbcaption"; $removals['CLASS'][] = "gallery"; } There's special handling for 'img' to do the alt text removal, but the 'thumb tright' and 'thumb tleft' will probably just get removed entirely... which matches what we're seeing on the Obama and Supernatural pages. Perhaps remove these from the removals list?
Merged https://gerrit.wikimedia.org/r/#/c/37514/