function ignoredTrailingSpace(node) {
   if (node.nodeType !== Node.TEXT_NODE) {
     return 0;
   }
 
   const trailingSpaceCount = /\s*$/.exec(node.textContent)[0].length;
 
   if (!trailingSpaceCount) {
     return 0;
   }
 
   return trailingSpaceCount - 1; // always allow single last
 }
@param {!Node} node to check for trailing space
@return {number} count of ignored trailing space