An HTML::Pipeline filter for Slack's mrkdwn markup language.
Add this line to your application's Gemfile:
gem 'html-pipeline-mrkdwn'
And then execute:
$ bundle
Or install it yourself as:
$ gem install html-pipeline-mrkdwn
Example:
require 'html/pipeline'
require 'html/pipeline/mrkdwn'
filters = [
HTML::Pipeline::PlainTextInputFilter,
HTML::Pipeline::Mrkdwn
]
pipeline = HTML::Pipeline.new filters
input = "*bold* will produce bold text"
result = pipeline.call(input)
puts result[:output].to_html
# => "<div>\n<strong>bold</strong> will produce bold text</div>"
Bug reports and pull requests are welcome on GitHub at https://github.com/jasongorst/html-pipeline-mrkdwn.
The gem is available as open source under the terms of the MIT License.