function normalizeTextNodeText(childNode) {
  // Just for typescript.
  if (!childNode.parentElement) return;
  // Just for typescript. If a text node has no text, it's trivially not significant.
  if (!childNode.textContent) return;

  let textContent = childNode.textContent || '';
  // Consecutive whitespace is redundant, unless in certain elements.
  if (!['PRE', 'STYLE'].includes(childNode.parentElement.tagName)) {
    textContent = textContent.replace(/\s+/g, ' ');
  }

  // Somehow evil newlines get into the text on Windows. Maybe somewhere in jsdom?
  textContent = textContent.replace(/\r\n/g, '\n');

  return textContent;
}
@param {ChildNode} childNode
@return {string|undefined}