src/edit/dompos.js
// Get the path for a given a DOM node in a document.
Get the path for a given a DOM node in a document.
Get the path for a given a DOM node in a document .
function pathFromDOM(pm, node) {
  let path = []
  for (; node != pm.content;) {
    let attr = node.getAttribute("pm-offset")
    if (attr) path.unshift(+attr)
    node = node.parentNode
  }
  return path
}
function pathFromDOM ( pm , node ) { let path = [ ] for ( ; node != pm . content ; ) { let attr = node . getAttribute ( "pm-offset" ) if ( attr ) path . unshift ( + attr ) node = node . parentNode } return path }
Get the path for a given a DOM node in a document.
Get the path for a given a DOM node in a document .