[cl-markdown-devel] div tags

Bob Hutchison hutch at recursive.ca
Wed Feb 28 14:24:41 UTC 2007


Hi Gary,

On 27-Feb-07, at 10:15 AM, Gary King wrote:

> Hi Hans,
>
> I have a fix for the errant paragraph tags but I'm not sure I like  
> that Markdown doesn't apply markdown inside the blocks. I.e., I'd  
> rather that
>
> <div>
>
> ## Header
>
> </div
>
> become
>
> <div>
> <h2>Header</h2>
> </div>
>
> What's your opinion? Is there a justification for one behavior over  
> the other.

I've seen arguments about this, but they tend to go on forever and so  
I tend to tune out.

You might consider what happens if you do:

<p>
## Header
</p>

For an alternative approach, you can look at maruku <http:// 
rubyforge.org/projects/maruku/> which is another Ruby implementation  
of markdown. Maruku adds an attribute it recognises to the html, so...

<div markdown="1">
## Header
</div>

will do as you want. Maruku will attempt to avoid doing something  
obviously wrong, e.g. it will not convert the heading inside a  
paragraph example from above since a heading is not allowed in a  
paragraph. Maruku will also strip the markdown attribute from the  
output. Unfortunately, using this input with the real markdown  
processor will not strip the attribute.

Textile will process the content inside html tags, and it will put  
headers inside paragraphs. That isn't so good.

You might want to worry about this when you have lots of time, it  
sounds like a bit of a can of worms to me.

Cheers,
Bob

>
> thanks,
>
> On Feb 26, 2007, at 9:50 AM, Hans Halvorson wrote:
>
>> cl-markdown does not yet treat <div> tags in the special way that
>> perl-markdown treats them; instead cl-markdown wraps <div> tags in  
>> <p>
>> tags.  Here is an example input string:
>>
>>
>> input string (9 lines total):
>> =============================
>>
>> <div class="header">
>>
>> Header text
>>
>> </div>
>>
>> # Heading
>>
>> Some text
>>
>>
>> Here are the respective output strings:
>>
>> cl-markdown output:
>> ===================
>>
>> <p><div class="header"> </p><p>Header text </p><p></div> </ 
>> p><h1>Heading </h1>
>> <p>Some text </p>
>>
>>
>> perl-markdown output:
>> =====================x
>>
>> <div class="header">
>>
>> Header text
>>
>> </div>
>>
>> <h1>Heading</h1>
>>
>> <p>Some text</p>
>>
>>
>> See the description of how perl-markdown treats div tags:
>> http://daringfireball.net/projects/markdown/syntax#html
>>
>> Thanks,
>> Hans
>> _______________________________________________
>> cl-markdown-devel mailing list
>> cl-markdown-devel at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/cl-markdown-devel
>
> --
> Gary Warren King, metabang.com
> Cell: (413) 885 9127
> Fax: (206) 338-4052
> gwkkwg on Skype * garethsan on AIM
>
>
>
>
> _______________________________________________
> cl-markdown-devel mailing list
> cl-markdown-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/cl-markdown-devel

----
Bob Hutchison                  -- blogs at <http://www.recursive.ca/ 
hutch/>
Recursive Design Inc.          -- <http://www.recursive.ca/>
Raconteur                      -- <http://www.raconteur.info/>
xampl for Ruby                 -- <http://rubyforge.org/projects/xampl/>






More information about the Cl-markdown-devel mailing list