How to use the mjml-core.documentParser function in mjml-core

To help you get started, we’ve selected a few mjml-core 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 mjmlio / mjml / packages / mjml-cli / src / client.js View on Github external
.then(content => {
      const MJMLDocument = documentParser(content.toString())
      const body = find(MJMLDocument.children, ['tagName', 'mj-body'])

      if (!body || body.children.length == 0) {
        return;
      }

      const report = MJMLValidator(body.children[0])
      const outputFormat = availableErrorOutputFormat[format] || availableErrorOutputFormat['text']

      error(outputFormat(report))
    })
    .catch(e => {