Page MenuHomePhabricator

IPA content should not be hidden in response
Closed, ResolvedPublic

Description

The mobile content service appears to replace IPA content with the following code:

<span>
<span class="ipa_button"></span>
<span class="nowrap" style="display: none;">
<span class="noexcerpt"><span><a href="//upload.wikimedia.org/wikipedia/commons/c/ce/En-uk-Sunderland.ogg"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Speakerlink-new.svg/11px-Speakerlink-new.svg.png" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Speakerlink-new.svg/22px-Speakerlink-new.svg.png 2x, //upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Speakerlink-new.svg/17px-Speakerlink-new.svg.png 1.5x" height="11" width="11"></a></span><sup><span class="IPA" style="color:#00e;font:bold 80% sans-serif;padding:0 .1em"><a href="/wiki/File:En-uk-Sunderland.ogg">i</a></span></sup></span><span class="IPA nopopups"><a href="/wiki/Help:IPA_for_English">/<span style="border-bottom:1px dotted"><span>ˈ</span><span>s</span><span>ʌ</span><span>n</span><span>d</span><span>ər</span><span>l</span><span>ən</span><span>d</span></span>/</a></span></span></span>

This can be observed on https://en.wikipedia.org/api/rest_v1/page/mobile-sections/Sunderland_A.F.C.
This is problematic and error prone as it doesn't consider the context (e.g. it might be wrapped inside brackets).

Please remove the inline style from the .nowrap element. This can be done and should be done on the client via a css rule. This breaks other consumers of the API as usually this content is wrapped in brackets.

Common practice on the web is graceful degradation which this breaks. See this example:

Screen Shot 2016-08-01 at 4.57.36 PM.png (186×782 px, 48 KB)

Event Timeline

A more semantic response would be to give the top-most span the class ".ipa" and add the css rule:

.ipa .nowrap { display: none; }

@bearND is there a good reason you cannot do the above in a css file?

Change 309170 had a related patch set uploaded (by Jdlrobson):
Add class to IPA container, do not use inline style

https://gerrit.wikimedia.org/r/309170

Change 309170 abandoned by Jdlrobson:
Add class to IPA container, do not use inline style

https://gerrit.wikimedia.org/r/309170

Change 309170 restored by Jdlrobson:
Add class to IPA container, do not use inline style

Reason:
whoops

https://gerrit.wikimedia.org/r/309170

Change 309170 merged by jenkins-bot:
Add class to IPA container, do not use inline style

https://gerrit.wikimedia.org/r/309170

bearND claimed this task.

deploy/2016-12-15/c9b7386