@@ -363,7 +363,7 @@ async function serveRenderedTemplate(url: string, config: MaizzleConfig, rendere
363363 const doctype = rendered . doctype ?? templateConfig . doctype ?? '<!DOCTYPE html>'
364364
365365 html = await runTransformers ( html , templateConfig , absolutePath , doctype , rendered . tailwindBlocks )
366- html = `${ doctype } \n${ html } `
366+ if ( doctype ) html = `${ doctype } \n${ html } `
367367
368368 res . setHeader ( 'Content-Type' , 'text/html' )
369369 res . end ( stripForHtml ( html ) )
@@ -413,7 +413,7 @@ async function serveHighlightedSource(url: string, config: MaizzleConfig, render
413413 const doctype = rendered . doctype ?? templateConfig . doctype ?? '<!DOCTYPE html>'
414414 html = await runTransformers ( html , templateConfig , absolutePath , doctype , rendered . tailwindBlocks )
415415
416- html = stripForHtml ( `${ doctype } \n${ html } ` )
416+ html = stripForHtml ( doctype ? `${ doctype } \n${ html } ` : html )
417417
418418 const hl = await getHighlighter ( )
419419 const highlighted = hl . codeToHtml ( html , {
@@ -624,7 +624,7 @@ async function serveEmailEndpoint(url: string, req: any, res: any, config: Maizz
624624 const templateConfig = rendered . templateConfig
625625 const doctype = rendered . doctype ?? templateConfig . doctype ?? '<!DOCTYPE html>'
626626 html = await runTransformers ( html , templateConfig , absolutePath , doctype , rendered . tailwindBlocks )
627- html = `${ doctype } \n${ html } `
627+ if ( doctype ) html = `${ doctype } \n${ html } `
628628
629629 const text = createPlaintext ( stripForPlaintext ( html ) )
630630 html = stripForHtml ( html )
0 commit comments