views:

98

answers:

1

Smarty Pants sounds like a cool idea to me:

SmartyPants can perform the following transformations:

  • Straight quotes ( " and ' ) into “curly” quote HTML entities
  • Backticks-style quotes (``like this'') into “curly” quote HTML entities
  • Dashes (“--” and “---”) into en- and em-dash entities
  • Three consecutive dots (“...”) into an ellipsis entity

What's the best way to integrate this type of functionality into my Rails project? (The hyphens v. dashes thing drives me crazy!).

(I'm soliciting user input in markdown, so the ideal solution would be a markdown processor that does Smarty Pants transformations as well.)

+2  A: 

http://tomayko.com/writings/ruby-markdown-libraries-real-cheap-for-you-two-for-price-of-one :

[there are] two solid Ruby extension libraries: one that wraps Jon MacFarleane’s peg-markdown and one that wraps David Loren Parsons’s Discount. Both are complete implementations of core Markdown plus SmartyPants in C.

ax