It seems that Page Previews shows the "<translate>" tag in the preview when the destination page has it. It shouldn't be displayed.
It's possible this only happens if a translate tag is not closed in the current section and exintro parameter is used (see T168743).
<languages/> <translate> <!-- open translate tag in section 0 --> <!--T:1--> This page links instructions for common '''administrative tasks''' which you may wish to perform once your [[<tvar|inst-guide>Manual:Installation guide</>|installation]] of MediaWiki is completed. == New section == </translate> <!-- closed translate tag in section 1 -->
- Visit https://meta.wikimedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=extracts&titles=Community_Engagement&exsentences=5&exintro=1
- Note <translate> in the response.
- Visit https://meta.wikimedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=extracts&titles=Community_Engagement&exsentences=5&exintro=1&explaintext=1
- Note <translate> in the response
Any one of the following links shows the problem,
- go to https://meta.wikimedia.org/wiki/Technical_Collaboration
- hover over "Community Engagement", which points to https://meta.wikimedia.org/wiki/Community_Engagement
- hover over "Volunteer Supporters Network", which points to https://meta.wikimedia.org/wiki/Volunteer_Supporters_Network
In that page, there is also the link "Improve collaboration with communities in product development", which is a more complex case because anchors and HTML are involved in the destination page: https://meta.wikimedia.org/wiki/Wikimedia_Foundation_Annual_Plan/2016-2017/Final#Program_7:_Improve_collaboration_with_communities_in_product_development
- Before signing off on this, document this behavior in the extension's docs.
- Any <translate> tags encountered should be "flattened" inside the filterContent method
- Any <tvar|.*> tags encountered should be "flattened" inside the filterContent method - note the tag name will always begin with "tvar|" but the text after the pipe is arbitary e.g. <tvar|wmf>
This can be fixed either in the HtmlFormatter (upstream) or in the ExtractFormatter
A test is provided (only for translate tag) however it only seems to fail locally without HHVM.