Note This project is not actively maintained and replicates most of the behaviour and limitations of SmartyPants. If you want a more full-featured Java smart quotes library, check out KeenQuotes.
Smart Quotes converts straight ASCII quotes in HTML content to their typographically-correct equivalents.
For example, it converts
"She's a ripper, mate!"
into
“She’s a ripper, mate!”
It is an easy-to-use Java library with no dependencies other than Java 1.5 or higher. To correct quotes in your application which produces HTML, you can simply drop the JAR into your classpath and use it this way:
SmartQuotes smartQuotes = new SmartQuotes();
String educated = smartQuotes.educate("...");
Version | Date | Download |
---|---|---|
1.0 | 25 April 2009 | smartquotes-1.0.jar |
The Smart Quotes Confluence plugin uses this library to render smart quotes in the Confluence wiki.
Matt Ryall
smartquotes@mattryall.net
http://mattryall.net
John Gruber's SmartyPants was the inspiration for this project and provided a lot of guidance with the algorithm and regular expressions.