Seeing how no-one should send application/xhtml+xml to the browser [1], and development of the HTML standard is again happening [2], it would make sense to have Markdown.pl default to HTML tags. Maybe too late to change a default though. How does PHP Markdown and other implementations deal with this issue? [1]: http://www.hixie.ch/advocacy/xhtml [2]: http://www.w3.org/2007/03/html-pressrelease
Am Mittwoch, 02. Mai 2007 schrieb Allan Odgaard:> Seeing how no-one should send application/xhtml+xml to the browser > [1], and development of the HTML standard is again happening [2], it > would make sense to have Markdown.pl default to HTML tags. > > Maybe too late to change a default though. > > > How does PHP Markdown and other implementations deal with this issue? > > > [1]: http://www.hixie.ch/advocacy/xhtml > [2]: http://www.w3.org/2007/03/html-pressreleaseWhich markdown output is xhtml but not html 4? I'm not aware of any. As far as I know xhtml is in the general part (which is touched by markdown that is) pretty much the same as html4 but with some stricter rules. So any xhtml markdown output should be valid html 4! -- Milian Wolff http://milianw.de
On 5/2/07, Allan Odgaard <29mtuz102 at sneakemail.com> wrote:> Seeing how no-one should send application/xhtml+xml to the browser > [1], and development of the HTML standard is again happening [2], it > would make sense to have Markdown.pl default to HTML tags.One problem with this is... I don't have hard numbers but I'm guessing like 90% of CMS systems that support plugins like Markdown are XHTML based and few them offer a toggle to switch between XHTML or HTML markup. Markdown usage is primarily as a plugin to a CMS. To make Wordpress HTML 4.01 compliant you have to roll your sleeves up and alter the source code. I went through PHP Markdown's source and there's a config option at the top of the file: # Change to ">" for HTML output define( 'MARKDOWN_EMPTY_ELEMENT_SUFFIX', " />"); -s
Allan Odgaard <29mtuz102 at sneakemail.com> wrote on 5/2/07 at 11:24 PM:> Seeing how no-one should send application/xhtml+xml to the browser [1], and > development of the HTML standard is again happening [2], it would make sense > to have Markdown.pl default to HTML tags.Funny, I was thinking just the opposite: that because the HTML5 spec has been updated to allow XHTML-style empty tags like `<this />`, that Markdown's --html4tags option could be deprecated and Markdown could just send XHTML-style tags all the time. I've converted most of DF to HTML5. I send my pages as text/html, I use XHTML-style empty tags, it should validate according to the current HTML5 draft spec, and it all works just fine in every browser I'm aware of. Put another way: If you use XHTML-style empty tags, Markdown's output works both in strict XML parsers [^1] and in tag soup HTML parsers. If you use HTML-style empty tags, Markdown's output will not work at all in an XML parser. The reason this works is that while real-world tag soup HTML parsers have no idea that the HTML5 spec has been updated to say `<this />` is now OK, it "just works" because they all just ignore the `/` as a bogus attribute anyway. -J.G.
Le 2007-05-02 ? 17:24, Allan Odgaard a ?crit :> Seeing how no-one should send application/xhtml+xml to the browser > [1], and development of the HTML standard is again happening [2], > it would make sense to have Markdown.pl default to HTML tags. > > Maybe too late to change a default though.I wouldn't change the default for the reasons John has enumerated. But I wouldn't remove the configuration option so easily either so people can still choose the HTML 4 syntax if they like. HTML 5 accepts both syntaxes as conformant in the current draft, a good middle ground in my opinion.> How does PHP Markdown and other implementations deal with this issue?In the PHP Markdown file, there is a setting for this: # Change to ">" for HTML output define( 'MARKDOWN_EMPTY_ELEMENT_SUFFIX', " />"); You can also set it programatically on a per-parser basis for when you instantiate your own parser object: $parser = new Markdown_Parser; $parser->empty_element_suffix = ">"; $html = $parser->transform($text); Michel Fortin michel.fortin at michelf.com http://www.michelf.com/