= Problem
It seems that Page Previews shows the "<translate>" tag in the preview when the destination page has it. It shouldn't be displayed.
= Replication steps
* 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.
= Cause
The HtmlFormatter when operating in plaintext mode operates on wikitext markup (not parsed output). It tidies up the extract, loads it into a DomDocument; flattens `span` elements; and removes elements matching the contents of $wgExtractsRemoveClasses
e.g.
```
bar <span>foo</span> test <div>to</div> bar
```
becomes
```
bar foo test bar
```
however, it doesn't flatten `translate` tags.
It should flatten `translate` tags
= Acceptance criteria
[] Any <translate> tags encountered should be "flattened" inside the filterContent method
= Developer notes
This can be fixed either in the HtmlFormatter (upstream) or in the ExtractFormatter
[[ https://gerrit.wikimedia.org/r/360984 Test for T167852 | A test is provided ]] however it only seems to fail locally without HHVM.
= Sign off
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