Getting around div tags

John Gruber gruber at fedora.net
Thu Mar 18 22:28:49 EST 2004


Aaron Swartz <me at aaronsw.com> wrote on 03/17/04 at 11:16p:

> What about if tags at column 1 don't process their contents and tags at 
> column 4 are code blocks (as they are now), but any tags in between 
> aren't wrapped with <p>s but get their contents processed. So the 
> problem would be solved by writing:
> 
>    <div class="mainarticle">
> This is some _cool_ text.
>    </div>
> 
>    <div class="sidebar">
> **Did you know?** President Lincoln had a beard.
>    </div>

Boy, I don't know. I do see the appeal in that, because it doesn't
involve using any additional non-space characters. 

But what rubs me the wrong way about it is that it makes the rules
for HTML block indentation tertiary, rather than binary.

Currently, the rule is:

*   If an HTML block is not indented, it's taken as raw HTML.
*   If it is indented, then it's a code block.
*   "Indented" = 4 or more spaces

There are only two states -- indented, or not indented.

With your proposal, we'd have three states: not indented, indented a
little, indented fully.

That stikes me as failing the "it ought to be easy to document" rule.

Really, I'm unconvinced we need this feature at all. I'd want to see
more cases where people want Markdown processing inside HTML blocks.

Maybe it's only `<div>` tags where this would ever even be
desirable, for example. I mean, you'd never want Markdown to start
adding `<p>` tags inside an HTML table.

-J.G.




More information about the Markdown-discuss mailing list