Re: and cie.

2013-02-08 Thread Waylan Limberg
On Fri, Feb 8, 2013 at 4:38 PM, Michel Fortin  wrote:
> In PHP Markdown 1.0.1p I started treating them as block-level elements and 
> they get the same treatment as ``, but implementations don't seem to 
> agree on this

I see three different outputs (babelmark2 shows more, but treatment of
whitespace and/or the encoding the apostrophe in "don't" are throwing
things off).

1) `` and its contents are untouched.
2) `` is left alone but its contents are processed as inline markdown.
3) The whole thing is wrapped in a `` and contents are processed as
inline markdown.

The reason for #3 is easy. Those parsers don't know anything about the
`` tag - which we all know is new in HTML5. Most likely, they
(like markdown.pl) have a hardcoded list of block level tags and
anything else in raw html is assumed to be span level tags. As I see
it, these can simply be ignored as being outdated/not supporting
HTML5. My suggestions would be to say that if you want to use HTML5
don't use these implementations. Yes, that means HTML5 support is a
feature, just like footnote support is a feature. Uhg.

I think it is safe to say that the reason for #1 is that the devs have
added the footer tag to the list of hardcoded block level tags - which
means it gets missed by span level parsing. These implementations can
say they support HTML5, but the lack-of-span-level-parsing feels
limiting.

I'm guessing that implementations of #2 work as they do because a
conscious decision was made to allow span level parsing. But what do
these implementations do for divs? I just checked and they also do
span level parsing inside `` and `` tags, etc.

http://johnmacfarlane.net/babelmark2/?normalize=1&text=%3Cp%3E%E2%80%94+%5BIgor+Wiedler+wins%5D(https%3A%2F%2Figor.io+)%3C%2Fp%3E%0A%0A%3Cdiv%3E%E2%80%94+%5BIgor+Wiedler+wins%5D(https%3A%2F%2Figor.io+)%3C%2Fdiv%3E%0A%0A%3Cfooter%3E%E2%80%94+%5BIgor+Wiedler+wins%5D(https%3A%2F%2Figor.io+)%3C%2Ffooter%3E

So, if you want to follow the
no-span-level-parsing-in-block-level-html rule, your left with
choosing #1 or #3 (the former being with HTML5 support). However, if
you want to ignore that rule, then #2 seems to be the way to go.

Personally, I've never liked that rule
(no-span-level-parsing-in-block-level-html), but it is a clearly
defined rule and should be the default behavior. I went with #1.

--

\X/ /-\ `/ |_ /-\ |\|
Waylan Limberg
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


and cie.

2013-02-08 Thread Michel Fortin
Question: what should be the output for this:

> for me the point of having my blog as a static site is mainly easy 
deployment
> I don't have to worry about even configuring PHP
> I just put html on a web server and boom! instant win
>
> ā€” [Igor Wiedler wins](https://igor.io)

The real question is how to treat ``. Is it a block-level element like 
``? That should mean that the content would be passed to the output 
literally. One thing for sure, it's not a span element, as the HTML spec 
forbids putting it inside a ``. Perhaps is should be something in between. 
Many of the new HTML5 elements are in that same situation.

In PHP Markdown 1.0.1p I started treating them as block-level elements and they 
get the same treatment as ``, but implementations don't seem to agree on 
this (and yes PHP Markdown Extra gives something that makes no sense):
http://johnmacfarlane.net/babelmark2/?normalize=1&text=%3E+for+me+the+point+of+having+my+blog+as+a+static+site+is+mainly+easy+deployment%3Cbr%3E%0A%3E+I+don't+have+to+worry+about+even+configuring+PHP%3Cbr%3E%0A%3E+I+just+put+html+on+a+web+server+and+boom!+instant+win%0A%3E%0A%3E+%3Cfooter%3Eā€”+%5BIgor+Wiedler+wins%5D(https%3A%2F%2Figor.io)%3C%2Ffooter%3E%0A

I find it somewhat worrying that the reference tool (Markdown.pl) treats it as 
a span element. Well, I don't care that much about what old Markdown.pl does, 
but I do care about people trying it there on the dingus and finding that it 
works as they intended (if they only look at the rendered output, they won't 
see the mess in HTML tags), and then getting an unexpected and undesired result 
with other implementations.

Reference:
https://github.com/michelf/php-markdown/issues/67

-- 
Michel Fortin
michel.for...@michelf.ca
http://michelf.ca/

___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss