Page MenuHomePhabricator

MobileFrontend strips too much content in images disabled mode
Closed, ResolvedPublic

Description

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.


Version: unspecified
Severity: normal

Details

Reference
bz42492

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:02 AM
bzimport set Reference to bz42492.

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

brion added a comment.Dec 7 2012, 8:08 PM

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?