我有以下代码
<p>
<%= sanitize "<p>This is a test</p>" %>
</p>
我希望经过清理的 html 会出现在<p></p>
. 然而它会产生。
<p>
</p>
<p>This is a test</p>
当我将封闭更改<p></p>
为 时<div></div>
,经过清理的 html<div></div>
会按我的预期显示在两者之间。
为什么在<p></p>
从封闭标记中删除经过处理的 html 并将其放在封闭标记之后之间的 html 清理?
如何让经过消毒的 html 显示在其中<p></p>
?