Background
We would like to show a different type of preview for pages where it is not possible to get extracts. A generic special preview "We cannot show the preview" should be shown when we hit these pages.
At the moment, Page Previews processes an extract that it gets from the service (MediaWiki API and RESTBase endpoint). It then tests whether the extract looks empty-ish in client side JavaScript. When the service can indicate that a preview is empty, then these tests should be removed from the codebase/PP should only rely on the service.
Related: T168392
Implementation
Possible options:
We should 404 if the extract is emptyWe should omit the extracts field- We should provide an empty string
Definition of empty
- If an extract field is an empty string and extract_html is also empty
- extract_html is empty when rendered has no textContent
Closed Questions
- Which implementation?
@phuedx: The summary-html route in MCS (T168848).
- Which service?
@phuedx: The Page Summary API (see above and the spec.
- Should we move extract processing to the server before tackling this? Or is it a part of this?
@Jdlrobson: I think this is out of scope. This is about what to do when the extract is empty.