Page MenuHomePhabricator

Add configurable noexcerpt in inline Phonos
Open, MediumPublicFeature

Description

In T315605 there was .noexcerpt added to all Phonos outputs. However, on some wikis, e.g. plwiki audio templates are used in a way that expects that the label is in fact rendered in page preview. See https://pl.wikipedia.org/wiki/Wikipedysta:Msz2001/Lech_Wa%C5%82%C4%99sa for an example of such a lead with an excerpt that would be generated for it. Currently the audio template had to be hacked so that the preview is generated correctly.

We don't display IPA in Polish, because the way you write something almost directly implies the way it's read (unlike English), so the player put directly in the article subjects that must be visible in a page preview.

After switching the template to Phonos, page preview is rendered incorrectly as: " – polski działacz związkowy i polityk", without the subject before the endash. This makes inline Phonos unsuitable for such use cases.

Therefore, I'd like to recommend an option in Phonos tag that configures whether or not to use the noexcerpt CSS class.

The original article which was used as an example is https://pl.wikipedia.org/wiki/Lech_Wa%C5%82%C4%99sa for example (excerpt can be seen here: https://pl.wikipedia.org/api/rest_v1/page/summary/Lech_Wa%C5%82%C4%99sa - it's correct due to hacks in https://pl.wikipedia.org/wiki/Szablon:Wymowa).

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I think .noexcerpt should be added explicitly to templates (rather then implicit, default class for Phonos).

I also did some tests with using offscreen span (visually hidden, shown for automatic readers) and that also didn't work. Is there some docs on what is hidden and what is shown?

There's some spec here: https://www.mediawiki.org/wiki/Page_Previews/API_Specification although it doesn't cover cases like display: none or other regarding styles.

TheresNoTime changed the subtype of this task from "Task" to "Feature Request".

Seems like tags with explicit display:none are removed. So the problem was not the span with class (like I assumed). I've modified our template and it should work now.

This is quite a workaround and it shouldn't be necessary in the first place IMO. Hard-coding noexcerpt in the extension assumes a very specific use case. It should be removed and left up to the communities.

I've included a link to a sandbox that contains wikitext equivalent to the template output before any hacks in it so that the problem can still be seen and reproduced.

Nikerabbit removed a project: Language-Team.