Re: spelling with ?
I am with Waylan on this one. :) Our approach has been to give the user the choice of three options: we'll remove HTML-like tags, or escape them, or leave them. Trying to sort them into HTML and non-HTML tags would be too error-prone and limiting (for the reasons Waylan mentioned). That said, there is no reason why markdown libraries couldn't accept an explicit list of "valid" tags as a parameter: html = markdown.markdown(text, extensions, options, allowed_tags=['a', 'i', 'b', 'img']) I suppose we could even set a few constants for you, so you could do something like: html = markdown.markdown(text, extensions, options, allowed_tags=markdown.HTML5_TAGS) In general, perhaps we should think more in terms of what options markdown libraries should support rather than in terms of what Markdown does by default. - yuri -- http://sputnik.freewisdom.org/ ___ Markdown-Discuss mailing list Markdown-Discuss@six.pairlist.net http://six.pairlist.net/mailman/listinfo/markdown-discuss
Re: spelling with ?
On Wed, Feb 20, 2008 at 1:19 AM, Petite Abeille <[EMAIL PROTECTED]> 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. looks like an HTML tag, Markdown recognize it as such, > > and you get it as an HTML tag in the output. > > Hmmm... yes... but... 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 [EMAIL PROTECTED] ___ Markdown-Discuss mailing list Markdown-Discuss@six.pairlist.net http://six.pairlist.net/mailman/listinfo/markdown-discuss
Re: spelling with ?
On Feb 19, 2008 10:19 PM, Petite Abeille <[EMAIL PROTECTED]> 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. looks like an HTML tag, Markdown recognize it as such, > > and you get it as an HTML tag in the output. > > Hmmm... yes... but... is not a HTML tag... shouldn't it be escaped > automatically much in the same way as < g > would? I'm unfamiliar with linguistics, but... looking back at the context of where you are using ``, it appears as if you are merely attempting to highlight the character "g", no? Wouldn't it be more appropriate to use something other than angle brackets? For example, you use square brackets a bit earlier in the paragraph; do square and angle brackets mean something distinct here? best, Joe -- Joseph Lorenzo Hall UC Berkeley School of Information http://josephhall.org/ ___ Markdown-Discuss mailing list Markdown-Discuss@six.pairlist.net http://six.pairlist.net/mailman/listinfo/markdown-discuss
Re: spelling with ?
Le 2008-02-20 à 1:19, Petite Abeille a écrit : On Feb 20, 2008, at 4:30 AM, Michel Fortin wrote: Markdown specifically allows you to use HTML in the middle of your prose. looks like an HTML tag, Markdown recognize it as such, and you get it as an HTML tag in the output. Hmmm... yes... but... is not a HTML tag... shouldn't it be escaped automatically much in the same way as < g > would? Well, if you saw in the middle of an HTML document you'd think of it as a tag, undefined and of of unknown semantics perhaps, but a tag anyway. Should markdown only allow a certain list of HTML tags based on the HTML specification? I think it'd be inconsistent to have and give different results than and . Also note that some people do use tags which aren't specified in any standard -- to use browser- specific features for instance, or as markup for chained HTML preprocessors -- and that standards *do* changes over time. For all these reasons, I don't think whitelisting a specific set of tag names is a good idea. Now, it's true that thesolution doesn't looks too appealing. I think it'd be much better if you could write: \ when you need to have a litteral "tag". Another solution would be to use something like PHP Markdown's no-markup mode, where tags are plain and simply disallowed, with the disadvantage that it would make the text less "portable" between different Markdown implementations. Michel Fortin [EMAIL PROTECTED] http://michelf.com/ ___ Markdown-Discuss mailing list Markdown-Discuss@six.pairlist.net http://six.pairlist.net/mailman/listinfo/markdown-discuss