I am puzzled then: so what would happen if the template will replace this island form your example with markup without closing `</em>`?
<p>
<em>Some replaced text
</p>
Which, by the HTML standard, will automatically close the `</em>` as the `</p>` closes.