Steps to replicate the issue (include links if applicable):
- Go to https://www.mediawiki.org/wiki/Special:ExpandTemplates, tick "Show raw HTML"
- Try either of the examples below
| <div><small> 2 </small> </div> | <div> <small> 2 </small></div> |
What happens?:
It will return respectively
| <div><small> </small><p><small>2 </small> </p> </div> | <div> <p><small> 2 </small></p><small> </small></div> |
Note that there is a <small> tag that only contains the newline character.
However, these the two examples
| <div> <small> 2 </small> </div> | <div><small> 2 </small></div> |
return respectively
| <div> <p><small> 2 </small> </p> </div> | <div><small> <p>2 </p> </small></div> |
free of the empty tags.
What should have happened instead?:
The two problematic examples are themselves valid HTML. It's confusing to see extra <small> being inserted.
Software version: 1.45.0-wmf.14