src/edit/dompos.js
// Get a child node of a parent node at a given offset.
Get a child node of a parent node at a given offset.
Get a child node of a parent node at a given offset .
function findByPath(node, n, fromEnd) {
  let container = childContainer(node)
  for (let ch = fromEnd ? container.lastChild : container.firstChild; ch;
       ch = fromEnd ? ch.previousSibling : ch.nextSibling) {
    if (ch.nodeType != 1) continue
    let offset = ch.getAttribute("pm-offset")
    if (offset && +offset == n) return ch
  }
}
function findByPath ( node , n , fromEnd ) { let container = childContainer ( node ) for ( let ch = fromEnd ? container . lastChild : container . firstChild ; ch ; ch = fromEnd ? ch . previousSibling : ch . nextSibling ) { if ( ch . nodeType != 1 ) continue let offset = ch . getAttribute ( "pm-offset" ) if ( offset && + offset == n ) return ch } }
Get a child node of a parent node at a given offset.
Get a child node of a parent node at a given offset .