T165017 introduces a new endpoint that returns HTML. It should be possible for page previews to consume this new API.
= Sign off criteria
[] On reading web staging when I hover over a link I see a text extract in HTML as provided by the new summay endpoint.
[] It is configurable and in production we continue to use the plain text mode for our previews.
[X] Ensure the following pages are testable on the beta cluster:
- https://ar.wikipedia.org/wiki/%D8%AE%D9%84%D8%A7%D9%81%D8%A9_%D8%A5%D8%B3%D9%84%D8%A7%D9%85%D9%8A%D8%A9 (rtl scripts)
- https://en.wikipedia.org/wiki/Lie_group (mathematical expressions, hover on "lie algebra"), https://en.wikipedia.org/wiki/Lie_algebra
- https://en.wikipedia.org/wiki/Earth (lists, hover on "planet"), https://en.wikipedia.org/wiki/Planet
- https://en.wikipedia.org/wiki/Berlin (parentheticals, hover on "Germany", https://en.wikipedia.org/wiki/Germany
- https://en.wikipedia.org/wiki/Alejandro_Gonz%C3%A1lez_I%C3%B1%C3%A1rritu (parantheticals, hover on "birdman"), https://en.wikipedia.org/wiki/Birdman_(film)
- https://en.wikipedia.org/wiki/List_of_bands_from_Finland, https://en.wikipedia.org/wiki/Marko_Saaresto (lists, hover on "list of bands from finland)
== Post sign off
[] Open a task about cleaning up the config.
== Dev Notes
* This'll require a new gateway as we'll want to test this in isolation. The `wgPopupsAPIUseRESTBase` configuration variable controls whether or not to consume the RESTBase Page Summary API. Perhaps this configuration variable needs revisiting, e.g. it could be superseded by a variable that can have the values "mediawiki", "restbase", and "restbase-experimental"?
** Alternatively the endpoint can be configurable e.g. wgPopupsApiRESTBaseEndpoint and the new endpoint can simply be used with wgPopupsAPIUseRESTBase
* Currently the renderer does additional processing on the plain text extract that it gets from the preview model (see `ext.popups.renderer#renderExtract`), this could be extracted to the preview model, i.e. `ext.popups.PreviewModel#getHtml`. The new gateway could return a specialised instance of `ext.popups.PreviewModel`.