How to use the simple-html-tokenizer.generate function in simple-html-tokenizer

To help you get started, we’ve selected a few simple-html-tokenizer 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 camptocamp / ngeo / buildtools / svg-viewbox-loader.js View on Github external
height = parseFloat(attribute[1]);
        }
      }
      if (width !== undefined && height != undefined) {
        tag.attributes = tag.attributes.filter((attribute) => {
          return attribute[0] !== 'width' && attribute[0] != 'height'
        })
        tag.attributes.push(['viewBox', `0 0 ${width} ${height}`, true]);
        tag.attributes.push(['height', '1em', true]);
        tag.attributes.push(['width', `${width / height}em`, true]);
      }
    }
    return tag;
  })

  return simpleHTMLTokenizer.generate(tokens)
};