Detect first list item with block elements

With an HTML structure like below, the Indent button is enabled when we put caret on the first item. Function firstItemInPath tried to compare <p> to <li>. The fix gets the <li> element of path.

{{{
<ul>
  <li><p>First</p></li>
  <li><p>Second</p></li>
</ul>
}}}