code: 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;
        }
      }
    }
docs: look for trailing whitespaces, bypass any inline tags