0.0
No commit activity in last 3 years
No release in over 3 years
Magnet specified markdown processor
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0
~> 3.0

Runtime

 Project Readme

Magnet::Markdown

Gem Version Build Status Dependency Status

Magent specified markdown processor. Inspired by qiita-markdown.

Default processors:

  • Magnet::Markdown::Filter::Markdown: convert markdown to html
  • Magnet::Markdown::Filter::Sanitize: whitelist sanitize user markup
  • HTML::Pipeline::Filter::ImageMaxWidthFilter: link to full size image for large images
  • Magnet::Markdown::Filter::Emoji: covert :emoji: to img elements

Installation

Add this line to your application's Gemfile:

gem 'magnet-markdown'

And then execute:

$ bundle

Or install it yourself as:

$ gem install magnet-markdown

Usage

Magnet::Markdown::Processor provides markdown rendering:

processor = Magnet::Markdown::Processor.new
processor.call(markdow)
# => {
#   output: '<h1>Example</h1> ...'
# }

Options

  • emoji_root: base url to link to emoji sprite
  • emoji_path: url path to link to emoji sprite. :filename can be used as a placeholder for the sprite file name. If no emoji_path is set "emoji/:filename" is used.
  • allow_script: Default false. If set true, Do not remove script elements.

Contributing

  1. Fork it ( https://github.com/magnet-inc/magnet-markdown/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request