Incorrect behaviour (Markdown 1.0b4)

John Gruber gruber at fedora.net
Tue Mar 30 12:01:44 EST 2004


Craig Morgan <craig.morgan at sun.com> wrote on 03/30/04 at 9:54a:

> I accidentally forgot to quote an inlined code segment yesterday during 
> Markdown use and observed that Markdown is recognising underscored 
> delimiters even without whitespace.
> 
> A bug I think ...
> 
> ---- Example input ----
> 
> .... recovery procedure is detailed in the command_reference_guide.pdf, 
> App. B
> 
> ---- Example output ----
> 
> <p>&#8230; recovery procedure is detailed in the 
> command<em>reference</em>guide.pdf, App. B</p>

Feature, not a bug.

The basic idea is that outside code spans/blocks, `*` and `_` are
always used to indicate phrase emphasis. E.g.:

    un*frigging*believable
    
    You say to*MAY*to, I say to*MAW*to

Thus you'd need to write the above as:

    command\_reference\_guide.pdf

I debated only allowing phrase emphasis to start and end at word
borders, but that seems quite restrictive. There's no way to do this
perfectly, other than mind reading. One way or the other, people are
going to inadvertantly use `*` and `_` the wrong way sometimes.

My thinking is that it's more consistent to say that they always
denote emphasis, except for within code, where they never do.

-J.G.


More information about the Markdown-discuss mailing list