How to use the html-minifier/dist/htmlminifier.js.HTMLParser function in html-minifier

To help you get started, we’ve selected a few html-minifier examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github icons8 / impresser / lib / html / CompressorAngular.js View on Github external
apply: function() {
    var
      content = '';

    new HTMLParser(this.content, {
      html5: typeof this.options.html5 !== 'undefined' ? this.options.html5 : true,

      start: function(tag, attrs, unary) {
        var
          attrIndex,
          attrName,
          attrValue,
          classNameBuilder,
          classList,
          className,
          classIndex;

        content += '<' + tag;
        for (attrIndex = 0; attrIndex < attrs.length; attrIndex++) {
          attrName = attrs[attrIndex].name;
          if (/^(?:data-)?ng[:-]?[\w-]+$/i.test(attrName)) {

html-minifier

Highly configurable, well-tested, JavaScript-based HTML minifier.

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis