Remove orphaned </p> tags that appear immediately after </ul> or </ol>.
Browsers auto-close <p> before block-level list elements, so AI-generated
markup of the form <p>intro</p><ul>…</ul></p> leaves a dangling </p>.
This function removes only that specific trailing </p> and does not attempt
any other HTML repair.
Remove orphaned
</p>tags that appear immediately after</ul>or</ol>. Browsers auto-close<p>before block-level list elements, so AI-generated markup of the form<p>intro</p><ul>…</ul></p>leaves a dangling</p>. This function removes only that specific trailing</p>and does not attempt any other HTML repair.