We should run the OutputPageBeforeHTML hook in VisualEditor API when returning page HTML after editing a page.
Two scenarios came up where that would be helpful:
- MobileFrontend uses the OutputPageBeforeHTML hook to apply mobile-specific transformations to the page (e.g. lead paragraph, collapsible sections). Because of this, VisualEditor currently has to reload the whole page after publishing an edit, instead of using the HTML returned by its API. This makes publishing slower. (T219420)
- DiscussionTools would like to use the OutputPageBeforeHTML hook to add the "Reply" links to comments on the page. Currently that is implemented in JavaScript, resulting in a small delay after the page loads but before the "Reply" links appear. However, that would cause those links to not appear after a discussion page is edited using VE or NWE. (T252555)