Hello everyone. It seems that I can post to the list now. Great. [1] I'm new to this list, and I've subscribed to discuss a design matter. Indeed, I'm currently writing a WebDev Toolkit in PHP for making the creations of simple websites and web applications quicker and easier (I'm fully aware that this kind of thing already exist, let's just say I'd doing it my way, 'cause nothing I've seen so far fulfills my needs, and also, I might learn one thing or two in the process). For allowing people who will use my toolkit to write content without having to include html tags, I've choosen the Markdown language (thanks to the PHP port). To me, it's the best markup language I've ever used so far. Now, to step forward to the problem I have : In a website, parts of the pages (essentially headers and footers) are often the same. Hence I've added a functionality to my toolkit : inclusion. It is performed when the parser finds "@include filename". The problem I have had is that these instructions are wrapped between <p> tags. Indeed I've tried to bypass the problem by many ideas, but since EVERYTHING is wrapped between <p> tags (including doctypes and all!), I get non-compliant html documents (my header defines the doctype and html head body tags too; and my footer closes the body and html tags; but these are wrapped into paragraphs...). Since the markdown language is aimed to be "a format for /writing/ for the web." and "not a replacement for HTML, or even close to it.", I think the md language should allow a strong usage of html tags, and even, to have .md files containing 99% of html tags. In the end, on the df website, it is said that "Markdown is smart enough not to add extra (unwanted) |<p>| tags around HTML block-level tags.". So I don't know if it's an implementation problem (related to the PHP port, maybe?), or if it's a design problem, but as far as I know, Markdown is not smart enough to not add unwanted <p> tags. Regards, Boris Le Ninivin. [1] I'm not really delighted to see that a GOOGLE email address is required to be able to post to this list. It might be a more or less effective way to reduce spam, but it's clearly not the correct one. Google uses the data from your emails to build profiles on you, and to [identify](http://donttrack.us/) and [bubble](http://dontbubble.us/) you. Therefore, I use a personal email address from a domain I own. And that one was rejected. I just wanted to point all that out while I'm at it. Oh and in case I'm wrong and that it was my domain which is blacklisted or anything else, do not pay attention to this complaint. :) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20120618/5fedc5e0/attachment.html>
On Mon, Jun 18, 2012 at 6:26 AM, Boris Le Ninivin <boris.leninivin at gmail.com> wrote:> Hello everyone. > > In a website, parts of the pages (essentially headers and footers) are often > the same. Hence I've added a functionality to my toolkit : inclusion. It is > performed when the parser finds "@include filename".[snip]> In the end, on the df website, it is said that "Markdown is smart enough not > to add extra (unwanted) <p> tags around HTML block-level tags.". So I don't > know if it's an implementation problem (related to the PHP port, maybe?), or > if it's a design problem, but as far as I know, Markdown is not smart enough > to not add unwanted <p> tags. >First, I should point out that while "Markdown is smart enough not to add extra (unwanted) <p> tags around HTML block-level tags" that only applies to *known* (and valid) HTML block level tags. "@include filename" is *not* a known HTML block-level tag - its not even HTML at all. I'm not sure how you implemented your inclusion stuff, but here's a few suggestions: If you are swapping your inclusion tag after markdown is run, then you need to match your inclusion tag wrapped inside a paragraph. Match this: `<p>@include filename</p>`. If you are swapping your inclusion tag before markdown is run, then we need to see what was swapped in to be of any help. If you have modified markdown (or used PHP Markdown's undocumented extension support), make sure your addition is running before raw HTML is handled by the parser. -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg
Le 2012-06-18 ? 6:26, Boris Le Ninivin a ?crit :> Now, to step forward to the problem I have : > > In a website, parts of the pages (essentially headers and footers) are often the same. Hence I've added a functionality to my toolkit : inclusion. It is performed when the parser finds "@include filename". > > The problem I have had is that these instructions are wrapped between <p> tags. Indeed I've tried to bypass the problem by many ideas, but since EVERYTHING is wrapped between <p> tags (including doctypes and all!), I get non-compliant html documents (my header defines the doctype and html head body tags too; and my footer closes the body and html tags; but these are wrapped into paragraphs...). > > Since the markdown language is aimed to be "a format for /writing/ for the web." and "not a replacement for HTML, or even close to it.", I think the md language should allow a strong usage of html tags, and even, to have .md files containing 99% of html tags.Except @include is not an HTML tag at all. You could instead use XML-style processing instructions, such as <?include blah blah ?>. PHP Markdown should handle them fine regardless of where you put them.> In the end, on the df website, it is said that "Markdown is smart enough not to add extra (unwanted) |<p>| tags around HTML block-level tags.". So I don't know if it's an implementation problem (related to the PHP port, maybe?), or if it's a design problem, but as far as I know, Markdown is not smart enough to not add unwanted <p> tags.That's only true for known HTML tags, and only the block-level ones.> [1] I'm not really delighted to see that a GOOGLE email address is required to be able to post to this list. It might be a more or less effective way to reduce spam, but it's clearly not the correct one. Google uses the data from your emails to build profiles on you, and to [identify](http://donttrack.us/) and [bubble](http://dontbubble.us/) you. Therefore, I use a personal email address from a domain I own. And that one was rejected. I just wanted to point all that out while I'm at it. Oh and in case I'm wrong and that it was my domain which is blacklisted or anything else, do not pay attention to this complaint. :)As far as I know, the only requirement is that you need to post using the address you subscribed with. -- Michel Fortin michel.fortin at michelf.com http://michelf.com/
> While we?re on it, though, I would like to note that you are definitely going to be breaking some users? expectations and existing documents here. > > Example paragraphs that are now lists: > > A. Hogan wrote, "lorem ipsum?" > > I. Don?t. Know. > > I. C. Weiner was my favorite prank call joke. > > Z. mentions he/she doesn?t know if all the allegations are true, ... (abbreviated confidential informant). > > ________________________Then maybe A) would be a better code for letter-lists and i.) could be roman numerals. 1) could be a variant for numbered lists too. The problem with checking how the list goes on is, that it is a lot more complex and breaks the lazy numbering feature.