mise();

// HTML for the elements in the with the body HTML inside the
// top-most element.
function tagStackToHtml(stack, body) {
  var stackReverse = stack.slice();
  stackReverse.reverse();
  return (
    '<' + stack.join('><') + '>'
    + body
    + '</' + stackReverse.join('></') + '>'
  );
}

(function () {
  var nNeededLast = Infinity;

  // We need a function that tells us which elements we need to have on the
  // open element stack so that we can get the outer element on the stack to
  // test whe