
jsprettify
jsPrettify converts plain ASCII punctuation characters into “smart” Unicode typographic characters. It’s written in Javascript, so you can use it virtually anywhere online, either to clean up your own outgoing text before it’s sent or to prettify sites you host or visit.
jsPrettify performs the following transformations: * Straight quotes ("" and '') are converted into curly quotes (“” and ‘’). * Hyphen-dashes (“---” and “--”) are converted to em- and en-dashes (“—” and “–”). * Three dots (“...”) are converted to a horizontal ellipsis character (“…”).
Check out a live demo: <wiki:gadget url="http://jsprettify.googlecode.com/hg/gadgets/example_gadget.xml" border="0" height="100"/>
Read about * MakingInputsPretty — by using the bookmarklet, or * MakingPagesPretty — by embedding the source in your blog.
jsPrettify can work on strings or on HTML http://www.w3.org/DOM/'>DOM elements. Because it works in your browser, it doesn’t have to parse HTML; it just walks the pre-existing DOM structure. Because it’s written using Google Closure, it’s extremely likely to work in your browser—I’ve personally tested it in Google Chrome, Firefox 3+, and IE6+.
If you use jsPrettify, show your support by adding it to your stack on Ohloh! <wiki:gadget url="http://www.ohloh.net/p/482111/widgets/project_users_logo.xml" height="43" border="0"/>
Project Information
- License: Apache License 2.0
- 18 stars
- hg-based source control
Labels:
closure
typography
javascript
utility
small
bookmarklet
library