分享 html-pipeline: Chainable Content Filters

linjunpop · 2012年11月28日 · 最后由 huacnlee 回复于 2012年11月28日 · 2616 次阅读

https://github.com/blog/1311-html-pipeline-chainable-content-filters

pipeline = HTML::Pipeline.new [
  HTML::Pipeline::MarkdownFilter,
  HTML::Pipeline::SyntaxHighlightFilter
]
result = pipeline.call <<CODE
This is *great*:

    some_code(:first)

CODE
result[:output].to_s

看起来很不错啊!

@huacnlee 也许 RubyChina 可以用这个?

没有必要调整了,Ruby China 的 Markdown 里面有许多细节的,看起来那个没有特别值得话这么大工程去替换的

需要 登录 后方可回复, 如果你还没有账号请 注册新账号