treating doctype and php as block-level elements

Yuri T. qaramazov at gmail.com
Sat Nov 19 23:02:26 EST 2005


Someone pointed out to me recently that python-markdown wasn't
wrapping non-block-level with <p> tags, so I added a check. However,
I then realized some of my files were getting screwed up because I
would end up getting a <p> tag wrapped around doctype strings and php
code. This, however, appears to be exactly what Perl markdown does.

I suggest that both of those should be treated as block-level HTML
constructs. With doctype this should be straighforward - I cannot
imagine why one would need to have "<!DOCTYPE...>" wrapped
"<p>...</p>". For <?php> tags, you might want it either way, but I
think it is better to assume that a <?php> tag starting a new line is
a block level element, since in this case one can easily force a <p>
tag around it by just indenting the <?php by one space. On the other
hand, if <?php tags get wrapped by default, there is no way of
inserting a div via php without getting an unnecessary <p> around it.

Of course this shouldn't be limited to PHP, so it might be just better
to treat all tags starting with <?, <@ and <% this way.

- yuri

--
http://www.freewisdom.org/


More information about the Markdown-Discuss mailing list