spelling with <g>?

Waylan Limberg waylan at gmail.com
Wed Feb 20 12:54:38 EST 2008


On Wed, Feb 20, 2008 at 1:19 AM, Petite Abeille
<petite.abeille at gmail.com> wrote:

>

> On Feb 20, 2008, at 4:30 AM, Michel Fortin wrote:

>

> > Markdown specifically allows you to use HTML in the middle of your

> > prose. <g> looks like an HTML tag, Markdown recognize it as such,

> > and you get it as an HTML tag in the output.

>

> Hmmm... yes... but... <g> is not a HTML tag... shouldn't it be escaped

> automatically much in the same way as < g > would?

>


And whoever said we should limit this feature only to HTML?
Python-Markdown has within that last couple months received 2 bug
reports from people who were running their templates through markdown.
As least one was an xml based template (Mako I believe). These people
are creating templates with the template syntax using <%foo> style
tags and markdown among those tags. They then run the template through
markdown to get html and template syntax, which is then run through
the template engine to produce the final document.

At first I found this very strange, but on further reflection, I
suppose it is easier to edit markdown text than html, especially when
it's mixed with a xml variant. I say variant because <%foo> isn't
really xml. It's also why I personally don't like xml based template
syntaxes, but that's beside the point. The fact is, there are
real-world uses for any xml type tag being passed through markdown
unchanged.

As a side note, like php Markdown, Python-Markdown also has an
alternate behavior for raw html. In fact, version 1.7 (released
Monday) adds the ability to *escape* all raw html instead of removing
it, which would provide your desired behavior. Of course it would also
affect valid html tags in your documents. However, with the simple
extension api, it would be easy to override that behavior with your
own.



--
----
Waylan Limberg
waylan at gmail.com


More information about the Markdown-Discuss mailing list