Smarty Pants对我来说听起来是个很酷的主意:
SmartyPants 可以执行以下转换:
- 将直引号( "和 ' )转换为“ curl ”引号 HTML 实体
- 将反引号样式的引号(``like this'')转换为“ curl ”引号 HTML 实体
- 破折号(“--”和“---”)组成 en- 和 em-dash 实体
- 三个连续的点(“...”)组成一个省略号实体
将此类功能集成到我的 Rails 项目中的最佳方法是什么? (连字符 v. 破折号让我发疯!)。
(我正在征求用户对 markdown 的意见,因此理想的解决方案是一个也可以进行 Smarty Pants 转换的 markdown 处理器。)
最佳答案
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.
关于ruby-on-rails - Rails 中类似 Smarty Pants 的功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1408448/