Minor regexp oversight for setext headings

John Gruber gruber at fedora.net
Mon Oct 9 17:48:40 EDT 2006


Michel Fortin <michel.fortin at michelf.com> wrote on 10/9/06 at
12:47 AM:


> As much as I agree with you, I tend to believe it'll break

>backward compatibility for a couple of people. I've seen this

>a couple of times:

> Paragraph...

> Header

> ======

> Paragraph...

> although I don't remember exactly where. So I think this

>should be kept working.


OK. I don't feel strongly about it, I suppose.

But what about this:

#this#
that

Right now that gets turned into

<h1>this</h1>

<p>that</p>

and I think that's just plain wrong. The only reason this works is
by accident; so I plan to require a blank line here.



> About this:

> this

> hello

> =====

> that

> I wouldn't encourage anyone to write a two-line heading in

> most circumstances, but given ambiguous input, it does seem

> the most logical thing to do is to not separate contiguous

> text into parts. So I'd say it's one header and one paragraph:

> <h1>this

> hello<h1>

> <p>that</p>


After reading other comments in this thread, I'm inclined to say
that Setext-style headers should not have embedded newlines. In
which case the above would translate to:

<p>this
hello
=====
that</p>

I think.

-J.G.


More information about the Markdown-Discuss mailing list