How to use the mjml.documentParser function in mjml

To help you get started, we’ve selected a few mjml 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 / atom-linter-mjml / index.js View on Github external
return new Promise((resolve, reject) => {
          let MJMLDocument
          const filePath = TextEditor.getPath();
          const fileText = TextEditor.getText()

          try {
            MJMLDocument = documentParser(fileText)
          } catch (e) {
            reject(e)
          }

          const body = getMJBody(MJMLDocument)

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

          const report = MJMLValidator(body.children[0])
          const formattedError = report.map(e => {
            const line = e.line - 1
            const currentLine = TextEditor.getBuffer().lineForRow(e.line - 1)

            return {

mjml

MJML: the only framework that makes responsive-email easy

MIT
Latest version published 11 months ago

Package Health Score

85 / 100
Full package analysis