src/from_dom.js
function normalizeList(dom) {
  for (let child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {
    let name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null
    if (name && listTags.hasOwnProperty(name) && prevItem) {
      prevItem.appendChild(child)
      child = prevItem
    } else if (name == "li") {
      prevItem = child
    } else if (name) {
      prevItem = null
    }
  }
}
function normalizeList(dom) {
  for (let child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {
    let name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null
    if (name && listTags.hasOwnProperty(name) && prevItem) {
      prevItem.appendChild(child)
      child = prevItem
    } else if (name == "li") {
      prevItem = child
    } else if (name) {
      prevItem = null
    }
  }
}
function normalizeList ( dom ) { for ( let child = dom . firstChild , prevItem = null ; child ; child = child . nextSibling ) { let name = child . nodeType == 1 ? child . nodeName . toLowerCase ( ) : null if ( name && listTags . hasOwnProperty ( name ) && prevItem ) { prevItem . appendChild ( child ) child = prevItem } else if ( name == "li" ) { prevItem = child } else if ( name ) { prevItem = null } } }
Kludge to work around directly nested list nodes produced by some tools and allowed by browsers to mean that the nested list is actually part of the list item above it.
Kludge to work around directly nested list nodes produced by some tools and allowed by browsers to mean that the nested list is actually part of the list item above it .