tecznotes
Michal Migurski's notebook, listening post, and soapbox. Subscribe to this blog. Check out the rest of my site as well.
Oct 23, 2009 4:13pm
comments and markdown
The comments on Jeff Atwood's complaint about how site commenters don't read instructions are pretty interesting. Basic gist is that Jeff thinks users are dumb for not understanding how to format their comments according to Markdown rules, while his readers think Jeff is dumb for introducing new rules to a simple text box.
I poked around in the CSS2 spec and found a simple answer, "white-space: pre-wrap;".
This value prevents user agents from collapsing sequences of white space. Lines are broken at newlines in the source, at occurrences of "\A" in generated content, and as necessary to fill line boxes.
That one thing on output plus automatic conversion of URLs into links should make prety much all of Markdown and other similar text-flavoring tricks unnecessary. Indentation, line-breaks, ASCII lists, all that stuff is simply preserved just like it's been in plain old email for a million years. I converted the comments on this page to use it, curious to see if it does the thing.
Comments (10)
Well, let's see if it works: * One * One-and-a-half * Two * Two-and-a-half * e * Three * Pi * Three-and-a-half > Let's pretend we're using a tiny > tiny console and we're quoting > an email. Look out for the grue. Let's see how it goes.
Posted by Coda Hale on Friday, October 23 2009 6:51pm UTC
Well dang. Supported by all major browsers, too.
Posted by Coda Hale on Friday, October 23 2009 6:52pm UTC
Doesn't work in IE6, unfortunately: http://skitch.com/bgreenlee/nrqyw/windows-xp-ie-6-running-sun-virtualbox
Posted by Brad Greenlee on Friday, October 23 2009 6:57pm UTC
MMMMMMMMM XXXX X XXXX XXX XX .X. 'XXX XX XXX.....XXXXX. X XX XX :".. X XX. MXX XXX XX :"" X X XX XX. XX XX X X X XX XX X X .....::::.. .XXXXXX X ..::MMMMMMMM""""MMMMMMM:. I. X X ..::MMMMMM MM MM .. IM MMMI IMMM::..........::MMMMMMMMM MI '' IMM IM IM MMMMM' M""""""MMMMMMM""MMMM MMMI IMMMM MMMM "" MM IMMM M.. ..M MM MMMM MMMMMI IMMMM MMMM :MMM MMMMM MMM MMM MMMM MMMM IMMMI IMMMM MMMM MMMM MMMMI MMM MMM IMM MMMM MMMMMI IMMMM MMMM..MMMM IM IMM MMM MMMM MMMM MMMMMI IMMMMMMMMMMMMMMMMMMMMMM MM MMM MMMM ""IM IMMMMMMMM""X .X X """I MM..MMM MM....IMMMMMMM"" X X XXXXX ""MMMMMMMMMMMMMM"" X X' XX XX X X' XX XX X .X' XX XX X X XX XX XX XX XXX X XX XXX XXX XXX XXX XXXX XXXX "XXXXXXXXX"
Posted by Sam Quigley on Friday, October 23 2009 6:58pm UTC
Or IE7.
Posted by Brad Greenlee on Friday, October 23 2009 7:00pm UTC
Feh. I guess you'd need a monospace font for that to have worked. Oh well. (That was supposed to have been the Teletype logo, by the way.) -sq
Posted by Sam Quigley on Friday, October 23 2009 7:00pm UTC
Works in IE8.
Posted by Brad Greenlee on Friday, October 23 2009 7:01pm UTC
Argh, IE. Always a frustration.
Posted by Michal Migurski on Friday, October 23 2009 7:18pm UTC
Sam, it looks like a banana holding a large machine gun.
Posted by Joshua Bloom on Thursday, October 29 2009 4:52am UTC
looks pretty crap, even if it is easy.
Posted by simon on Friday, January 15 2010 4:14pm UTC
Sorry, no new comments on old posts.