src/htmlminifier.js
function trimTrailingWhitespace(index, nextTag) {
    for (var endTag = null; index >= 0 && _canTrimWhitespace(endTag); index--) {
      var str = buffer[index];
      var match = str.match(/^<\/([\w:-]+)>$/);
      if (match) {
        endTag = match[1];
      }
      else if (/>$/.test(str) || (buffer[index] = collapseWhitespaceSmart(str, null, nextTag, options))) {
        break;
      }
    }
  }
function trimTrailingWhitespace(index, nextTag) {
    for (var endTag = null; index >= 0 && _canTrimWhitespace(endTag); index--) {
      var str = buffer[index];
      var match = str.match(/^<\/([\w:-]+)>$/);
      if (match) {
        endTag = match[1];
      }
      else if (/>$/.test(str) || (buffer[index] = collapseWhitespaceSmart(str, null, nextTag, options))) {
        break;
      }
    }
  }
function trimTrailingWhitespace ( index , nextTag ) { for ( var endTag = null ; index >= 0 && _canTrimWhitespace ( endTag ) ; index -- ) { var str = buffer [ index ] ; var match = str . match ( / ^<\/([\w:-]+)>$ / ) ; if ( match ) { endTag = match [ 1 ] ; } else if ( / >$ / . test ( str ) || ( buffer [ index ] = collapseWhitespaceSmart ( str , null , nextTag , options ) ) ) { break ; } } }
look for trailing whitespaces, bypass any inline tags
look for trailing whitespaces bypass any inline tags