Page MenuHomePhabricator

Text Extracts used in Page Previews shows strange characters from template
Closed, ResolvedPublic


When viewing a page preview that contains the {{nts}} template in the opening section Page Previews displays unwanted characters from the transcoded template instead of the expected number.

{{nts|2,887,974 }}

Steps to reproduce:
Enable Page Previews beta feature
Visit a page that contains a link to Kiev such as
Hover over the link to Kiev.


Screen Shot 2017-03-01 at 4.24.31 PM.png (377×588 px, 242 KB)

Expected behavior:
Just the desired output, in this example, "2,887,974"

The API result for the Kiev page on English Wikipedia:

Shows the HTML


Note: I'm also seeing the strange preview in Safari's autocompletion suggestions.

Screen Shot 2017-03-01 at 4.33.29 PM.png (157×734 px, 48 KB)

Event Timeline

Maybe something in the template missing a "noprint" class, like this?

Seems resolved by the template edit

Screen Shot 2017-03-02 at 4.04.26 PM.png (318×504 px, 213 KB)

ovasileva claimed this task.

Article edit, that is.

We'll have a look into having a generic class for hiding things from extracts, instead of using the class for hiding things for printing.

This looks a lot like T131923: prefixes geocoordinates for some articles using api interface btw.

Currently ignored classes are defined by site configuration, but that doesn't really scale I think. Either that configuration should be moved to on-wiki json blob, something like VE has for Citoid and the charinsert panel for instance, or indeed a separate classname or something.

And no matter what, as being user generated content, you will always have some of this, the point is giving the community influence on fixing that where required.

Here, it wasn't even really needed.