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. When we click on it, the rest of the list items is removed. Function old firstItemInPath tried to compare \<p> to \<li> and failed to detect the match. The fix gets the \<li> element of path.

{{{
\<ul>
  \<li>\<p>First\</p>\</li>
  \<li>\<p>Second\</p>\</li>
\</ul>
}}}