A number of places (cf https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/462753/10/includes/FileDeleteForm.php) contain a pattern like:
```
$wgOut->addWikiTextAsInterface('<div class="error">' . $something . '</div>');
```
Of course, (a) this breaks if `$something` has an extra `</div>`, and (b) the `$something` gives up its start-of-line context in an unpredictable way (something the pattern has a newline after the opening `<div>`, sometimes it doesn't).
It would be better to introduce a new interface which uses the (robust) wrapping functionality of ParserOutput instead:
```
$wgOut->addWikiTextAsInterfaceWrapped('error', $something);
```
Since the output of parsing `$something` is tidied by the `addWikiTextAsInterface` method, this would ensure that the wrapper is robust.
A few instances wrap calls to `Html::errorBox`, like:
https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/462753/10/includes/page/Article.php
but as far as I can tell no one uses the `$heading` option to errorBox, so these should be straightforward to replace with `$wgOut->addWikiTextAsInterfaceWrapped( 'errorbox', ...)`
There's also an OutputPage::wrapWikiMsg() function with similar functionality; it would be nice if it could be made safe, for example by parsing the content in a tidy safe and *then* composing it with the wrapper.