Bug: INS/DEL in block context (1.04b)

John Gruber gruber at fedora.net
Sun May 2 23:15:43 EDT 2004


Jelks Cabaniss <jelks at jelks.nu> wrote on 05/02/04 at 4:16p:

> > I thought Markdown was smart enough not to enclose block-level HTML
> > elements in paragraph tags.
>  
> Short answer:  focus on *inside* the `<body>`.  Markdown doesn't concern
> itself with the Doctype Declaration or `<head>` metadata.  Nor could it --
> all it knows is the authored text it's being fed, not assertions residing in
> your mind *about* that text.

Right, that's the idea exactly. Markdown.pl is *not* a document
processor. It turns plain text into snippets of HTML. To finish the
job and generate whole HTML files, you'll need a little bit of extra
work. Either a template system, or a small wrapper program that
calls out to Markdown.

This is the same reason Markdown doesn't have any concept of a "title".


> (These types of questions are coming up often enough that the subject
> probably warrants minimally addressing in the online docs.)

I should do a FAQ or a Wiki or something. Or a FAQ powered by a Wiki.


> Well, *I* don't blog and I use Markdown every day.  I've implemented it in a
> "Clip" in Notetab (my Windows text editor):  if there is selected text, my
> clip runs Markdown.pl on that text only.  Otherwise, it runs Markdown on the
> entire document, wraps the result in `<body>...</body>`, inserts the XHTML
> 1.0 Strict Doctype Declaration and a skeletal `<head>` section at the top
> (in the process making the `<title>` contain the contents of the first
> `<h1>` -- if one exists), then adds the closing `</html>`.  It then runs
> HTML Tidy on it.

That's exactly the sort of short wrapper I was talking about. :^)

-J.G.


More information about the Markdown-discuss mailing list