When using (1) a template that (2) has HTML (the allowed subset) (3) with nested elements (4) in lists then we have a problem. In plain wikitext the template usually works fine. But once the template is as a list item, it not only does not work but it is "ripped apart", meaning the inner elements are rendered not inside but AFTER their parents. This seems to happen due to mediawikis template parser and might be considered a bug.
-- TemplateTest <span class="parent"> <span class="child"> Text </span> </span>
Is fine as usual wikitext, but leads to the buggy behavior if the template is deployed as a list item
-- Page {{TemplateTest}} -- that's fine * {{TemplateTest}} - span.child is rendered AFTER and NOT inside span.parent