function parseHtml(html, tempContainer) {
  let parser = new DOMParser()
  let doc = parser.parseFromString(html, 'text/html')

  let chunks = []

  // IE does not give us an empty body, only a null one, shortcut the subsequent logic in this case
  if(!doc.body) {
    return chunks
  }

  insertIntoContainer(doc.body, tempContainer)

  try {
    innerRichText(tempContainer, chunks)
  } finally {
    emptyNode(tempContainer)
  }

  return chunks
}
Parses HTML into chunks of rich text.

Argh, getting the appropriate text from an HTML DOM tree is not simple. See
http://perfectionkills.com/the-poor-misunderstood-innerText/.

Implement Aryeh Gregor's aborted innerText proposal: https://www.w3.org/Bugs/Public/show_bug.cgi?id=13145
and https://rawgit.com/timdown/rangy/master/fiddlings/spec/innerText.htm, which works quite well (see the
test cases for this module).

The innerText algorithm presented by Gregor was slightly modified to return chunks of styled rich text
(text with attributes) based on the DOM nodes and their computed styles.

@param {string} html The html String to parse.
@param {Node} tempContainer An invisible container within the document that can hold the parsed HTML temporarily
  so that the browser can compute the CSS styles. This is a hack but there doesn't seem to be a better way of doing
  this.