Skip to content

Commit

Permalink
fix #234 allow attributes in mjml tag
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcb777 committed Apr 10, 2018
1 parent 25fbdec commit 5defeae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/helpers/mjml.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function(mjmlContent, filePath, mjmlPath = null, options = {}) {
window.requestIdleCallback(async () => {
try {
if (mjmlPath) {
if (!mjmlContent.trim().startsWith('<mjml>')) {
if (!mjmlContent.trim().startsWith('<mjml')) {
const stdinStream = new stream.Readable()
stdinStream.push(wrapIntoMJMLTags(mjmlContent))
stdinStream.push(null)
Expand All @@ -34,7 +34,7 @@ export default function(mjmlContent, filePath, mjmlPath = null, options = {}) {
resolve({ html: res.stdout, errors: [] })
}
} else {
if (!mjmlContent.trim().startsWith('<mjml>')) {
if (!mjmlContent.trim().startsWith('<mjml')) {
mjmlContent = wrapIntoMJMLTags(mjmlContent)
}
const mjmlOptions = {
Expand All @@ -43,6 +43,7 @@ export default function(mjmlContent, filePath, mjmlPath = null, options = {}) {
minify: !!options.minify,
}
const res = mjml2html(mjmlContent, mjmlOptions)

resolve({ html: res.html || '', errors: res.errors || [] })
}
} catch (e) {
Expand Down

0 comments on commit 5defeae

Please sign in to comment.