Skip to content

Commit

Permalink
Merge pull request #235 from mjmlio/fix-234
Browse files Browse the repository at this point in the history
fix #234 allow attributes in mjml tag
  • Loading branch information
meriadec authored Apr 10, 2018
2 parents 25fbdec + 5defeae commit dd78ad5
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 dd78ad5

Please sign in to comment.