index.js 425 B

12345678910111213141516171819
  1. "use strict";
  2. const parse = require("./parse");
  3. const stringify = require("./stringify");
  4. function postcssHtml(config) {
  5. const syntax = {
  6. parse: (source, opts) =>
  7. parse(String(source), { config, syntax, ...(opts || {}) }),
  8. stringify,
  9. };
  10. return syntax;
  11. }
  12. const defaultSyntax = postcssHtml();
  13. postcssHtml.parse = defaultSyntax.parse;
  14. postcssHtml.stringify = defaultSyntax.stringify;
  15. module.exports = postcssHtml;