This is Shadow2531's TypePad Profile.
Join TypePad and start following Shadow2531's activity
Shadow2531
Recent Activity
"You should have to do 2..."
Shouldn't I mean.
The Future of Markdown
Markdown is a simple little humane markup language based on time-tested plain text conventions from the last 40 years of computing. Meaning, if you enter this… …you get this! Lightweight Markup Languages ============================ According to **Wikipedia**: > A [lightweight markup lan...
I hate that markdown doesn't do bold, italics and underlining this way:
*bold*
/italics/
_underline_
where you escape *, / and _ with \ if you don't want styling.
That's how it should be as it matches text/plain email composition style. You should have to do 2 ** before and after to get bold.
The Future of Markdown
Markdown is a simple little humane markup language based on time-tested plain text conventions from the last 40 years of computing. Meaning, if you enter this… …you get this! Lightweight Markup Languages ============================ According to **Wikipedia**: > A [lightweight markup lan...
There's a common and accepted way to normalize newlines (using js regex for examples):
.replace(/\r\n|\r/g, "\n");
.replace(/\r\n|\r|\n/g, "\r\n");
.replace(/\r\n|\n/g, "\r");
The first method is used for server-sent events (not regex, but the normalizing of \r\n and \r to \n via parsing).
The second method is used in HTML5 for textarea value getters/setters. Opera does this already. However, Webkit currently uses the first method and Gecko and IE do different things depending on the situation.
You can use __lookupGetter/Setter__ and __defineGetter/Setter__ or Object.getOwnPropertyDescriptor and Object.defineProperty to patch a textarea's 'value' getter and setter to work around the differences in newline normalization.
Newlines being right for a textarea's value is important because it affects the value's length, which many sites (like Twitter) use as character counters to enforce limits.
I absolutely hate the newline deal though. I wish we could get rid of it and just use only \n everywhere.
As for a Unicode newline, I once tried to switch to using it (just to be
Unicode-proper and all that), but couldn't find anything that handled it
display-wise.
The Great Newline Schism
Have you ever opened a simple little ASCII text file to see it inexplicably displayed as onegiantunbrokenline? Opening the file in a different, smarter text editor results in the file displayed properly in multiple paragraphs. The answer to this puzzle lies in our old friend, invisibl...
Shadow2531 is now following The Typepad Team
Feb 16, 2010
Subscribe to Shadow2531’s Recent Activity
