When standalone is not specified, pandoc typically outputs fragments rather
than a complete document. This is convenient for the case where you are
processing multiple fragments into one document. (This happens in HTML
output but also in other output; groff -ms, ConTeXt, LaTeX.) So normal
HTML output I see when I don't specify standalone does *not* include the
doctype.
$ echo '* Bogus' | pandoc -r rst -w html
This is with pandoc 2.16.2, installed with homebrew.
On Tue, Dec 28, 2021 at 9:33 AM Joseph Reagle
wrote:
> The doctype declaration is a standard HTML feature and declares the
> version of the HTML. Pandoc, especially in `--standalone` mode includes
> these at the start of an HTML document.
>
> I'm confused, however. You haven't specified standalone mode. (And why
> would you want them removed in any case?) And the behavior you are
> describing doesn't correspond to recent versions -- I'm using 2.16.2. I'm
> not sure when/if pandoc last used HTML4.01 strict.
>
> In any case, you could create your own HTML template, without a doctype
> declaration.
>
> https://pandoc.org/MANUAL.html#templates
>
> On 21-12-27 15:04, philmac-97jfqw80gc6171pxa8y+qA@public.gmane.org wrote:
> > I am using Pandoc to convert dumb quotes to smart quotes in HTML. The
> HTML is on my MacOS clipboard:
> >
> > pbpaste | pandoc -t html+smart | pbcopy
> >
> > The output begins with
> >
> > http://www.w3.org/TR/html4/strict.dtd”>
> >
> > and a blank line.
> >
> > Is it possible to turn this off?
>
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/e8eac3cc-feb6-e3af-dc9d-d3fe0b964925%40reagle.org
> .
>
--
T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAN1EhV-RgQttr_0-LNmgHG-aMQ9L2Wre-_Ytz4PnghSF4S_8kw%40mail.gmail.com.