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

Jay Allen markdown at openwire.com
Wed Apr 28 11:14:45 EDT 2004


I've found two workarounds for this problem:

1) Encase the ins or del block within a plain <div></div>.  This stops 
processing of anything inside of the block-level div but unleashes the 
demons of ultimate semantic relevance on my ass.  It may also have 
other unintended consequences that I haven't run across.

2) Hack the Markdown source code on line 289 (v1.04b) from:

         my $block_tag_re = 
qr/p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script/;

to
         my $block_tag_re = 
qr/p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|ins|del/;

#2 may also have some unintended consequences since it seems that it 
will always treat an ins or del as a block-level element.  It is, 
however, the preferred choice for me (unless John tells me that I'm 
unleashing some greater form of hell on myself) at this point because 
99% of my usage of these tags is block level and there are 
approximately -- let's see -- an assload of entries in my installation 
which are affected by this problem.

Again, thoughts?

-j-
http://www.jayallen.org/


On Apr 28, 2004, at 4:57 PM, Jay Allen wrote:

> I pored through the archives (which really needs search 
> functionality), the documentation and even the Markdown source code 
> trying to understand how Markdown handles <ins></ins> and <del></del> 
> in the block-level context of it's dual life[1].
>
> For the record, in my Markdown formatted entry, I have something like 
> this:
>
> <ins datetime="2004-04-26T19:52:00+01:00">
> <p>
> <strong>Update:</strong> This is an update.
> </p>
> </ins>
>
> Since INS is used in a block-level context here, Markdown should leave 
> it alone.  However, it produces the following code.
>
> <p><ins datetime="2004-04-26T19:52:00+01:00"></p>
>
> <p>
> <strong>Update:</strong> This is an update.
> </p>
>
> <p></ins></p>
>
> Which is not only invalid, but HIGHLY illegal in XHTML-Strict for a 
> few reasons.  I played around for a while in the dingus 
> (http://daringfireball.net/projects/markdown/dingus) to see if I could 
> get Markdown to leave it alone, but I failed.  Once I looked into the 
> source code, I saw that there was no provision for treating INS and 
> DEL as block-level elements when they are used that way.
>
> So, there's the bug.  Now, the feature request: It would be grand if 
> Markdown could format INS and DEL in block-level context for us. 
> Perhaps something like:
>
> +datetime=2004-04-26T19:52:00+01:00
> +cite=http://blah.com
> +This is an update
> +
> +Ain't it grand
>
> -datetime=2004-04-26T19:52:00+01:00
> -cite=http://blah.com
> -This is a deleted section.
> -
> -Ain't it sad
>
> Or something like that.
>
> Any thoughts on bug or feature request?
>
> -j-
> http://www.jayallen.org/
>
> [1] - From http://www.w3.org/TR/REC-html40/struct/text.html#h-9.4
>
> -------
> These two elements are unusual for HTML in that they may serve as 
> either block-level or inline elements (but not both). They may contain 
> one or more words within a paragraph or contain one or more 
> block-level elements such as paragraphs, lists and tables.
>
> ILLEGAL EXAMPLE:
>  The following is not legal HTML.
> <P>
> <INS><DIV>...block-level content...</DIV></INS>
> </P>
> -------
>
> _______________________________________________
> Markdown-discuss mailing list
> Markdown-discuss at six.pairlist.net
> http://six.pairlist.net/mailman/listinfo/markdown-discuss
>



More information about the Markdown-discuss mailing list