dwyl / ampl

:iphone: :zap: Ampl transforms Markdown into AMP-compliant html so it loads super-fast!
GNU General Public License v2.0
58 stars 3 forks source link

markdown2AmpHTML emits <!doctype html> #32

Closed puppetmaster3 closed 7 years ago

puppetmaster3 commented 7 years ago

great project. <!doctype html> is a head tag.

Bug: var markdownString = '# Hello World!' // or read from a .md file ampl.markdown2AmpHTML({markdown:markdownString}, function(ampHtml) { console.log(ampHtml) }) emits <!doctype html>

Hello World!

<!doctype html> should not be emitted in the body. parseHtml() appears to put it no matter what to start. This bug also works if you use parse w/ headOverride: '' //empty header.

pankajpatel commented 7 years ago

https://runkit.com/pankaj/ampl-test

The doctype is appearing with markup. Opening a PR for the fix.