我有一篇 contentEditable 文章,其中包含“EmbeddedSection”div(递归),在它们的上方和下方都有一段。在 chrome 中,如果该段落为空,您实际上无法访问它。在 IE 中你可以,但大小都是错误的。
<article contenteditable="true">
<p><span class="numbering">Title</span><span class="TextChunk"></span></p>
<div class="EmbeddedSection">
<p><span class="numbering">1</span><span class="TextChunk">Section Title</span></p>
<div class="EmbeddedSection">
<p><span class="numbering">1.1</span><span class="TextChunk">Embedded title</span></p>
<p><span class="TextChunk">Th</span><span class="TextChunk">e </span><span class="TextChunk">.</span></p>
</div>
<p><span class="TextChunk"></span></p> <!--Can't get to this element-->
<div class="EmbeddedSection">
<p class="Paragraph"><span class="numbering">1.2</span><span class="TextChunk">Another title</span></p>
<p class="Paragraph"><span class="TextChunk">Blah blah blah</span></p>
</div>
<p><span class="TextChunk">Can get here, but not the one above 1.2 in chrome (ie gets there).</span></p>
<div class="EmbeddedSection">
<p class="Paragraph"><span class="numbering">1.3</span><span class="TextChunk">Another title</span></p>
<p class="Paragraph"><span class="TextChunk">Blah blah blah</span></p>
</div>
<p><span class="TextChunk"></span></p> <!--Can't get to this element-->
</div>
</article>
有谁知道我是否能够设置空段落的样式或以某种方式将它们标记为使它们可以访问的东西?
(注意:即使在用户编辑并删除了该空白字符之后,也可以放置单个空白字符。)