About CleanText.org

The goal here is to take text formatted like this:

"I try not to pay it much mind. Some people, they get overly grateful." He must've seen my eyes flick up again, to pull his Whuffie history. "Wait, don't go doing that -- I'll tell you about it, you really got to know.

[empty line]

"Damn, you know, it's so easy to get used to life without hyperlinks. You'd think you'd really miss 'em, but you don't."

And render it like this instead:

“I try not to pay it much mind. Some people, they get overly grateful.” He must've seen my eyes flick up again, to pull his Whuffie history. “Wait, don't go doing that — I'll tell you about it, you really got to know.

“Damn, you know, it's so easy to get used to life without hyperlinks. You'd think you'd really miss 'em, but you don't.”

That way, when it's rendered with a nice variable-width font, it ought to look more or less like this:

“I try not to pay it much mind. Some people, they get overly grateful.” He must've seen my eyes flick up again, to pull his Whuffie history. “Wait, don't go doing that — I'll tell you about it, you really got to know.

“Damn, you know, it's so easy to get used to life without hyperlinks. You'd think you'd really miss 'em, but you don't.”

In the above, take particular note of a few points:

  • "Doublequotes" were correctly translated to “smart” quotes in the order in which they appeared in the source text;
  • The second opening doublequote in the first paragraph did not cause the opening doublequote in the second paragraph to mis-render out of order;
  • The "--" em dash on the second was correctly turned into an em dash (—);
  • Straight apostrophes are not (yet) turned into nice ’s;

Beware! Pasting large blocks of text into a textarea in Firefox is liable to take several seconds to complete; Internet Explorer 8 seems to be about the same speed as FF 3.5; and Google Chrome is quite a bit slower. Execution time is mostly dominated by the running time of string.replace() and the overhead of the function call executed for each match, and the regex engine in most browsers is pretty fast... so, as in most text editing cases, runtime tends to be bottlenecked by I/O (how far we've come, to end up back here again!)

Regarding data collection, privacy and copyright concerns, all of CleanText.org's processing is entirely client-side. This approach means that the blocks of text never get sent to the server, and are processed, using Javascript, by your browser, on your local machine. The only information that is sent to the server is a notification to increase the counter. That's it. You can inspect the code yourself to validate, and we encourage you to do so. When you use Cleantext.org to tidy up your text you retain ownership of the copyright of all the text, and maintain all responsibility for its content. Please refer to the GPL Version 2 for disclaimers regarding suitability of the product for any purpose and liability.

All examples taken from Cory Doctorow's "Down and Out in the Magic Kingdom"; original inspiration for this tool comes from @doctorow's tweet, by way of Mekki MacAulay's mention; All JavaScript code on this page is published under the GPLv2; all markup and original text, CC A-SA 2.5 Canada; original version by Ben Zanin Lolcode courtesy of the Loler Project