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

Development

~> 1.11
>= 0
>= 0
~> 10.0
= 0.44.1

Runtime

>= 0
~> 1.12
>= 0
~> 1.8
 Project Readme

PotMarkdown

Build Status

PotMarkdown is markdown processor for Potmum.

Installation

Add this line to your application's Gemfile:

gem 'pot_markdown'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pot_markdown

Usage

require 'pot_markdown'

processor = PotMarkdown::Processor.new
context = {
  safe_script_url: false
}
processor.call("# title\n\n Hello, **Potmum!** ...", context)
# => {
#  toc: "<ul><li><a href=\"#id-title\">title ...",
#  output: "<h1 id=\"id-title\">title</h1>...",
#  mentioned_usernames: ['rutan', ...]
# }

context

  • anchor_icon
    • header link icon
    • default)
      • <i class="fa fa-link"></i>
  • checkbox_enable
    • not set attribute disabled to checkbox
    • default: false
  • checkbox_class
    • <li> 's class with checkbox
    • default: task-list-item
  • sanitize_rule
  • sanitize_use_external
    • to enable the particular script/iframe
    • ex)
      • Youtube
      • Twitter
      • niconico
      • SlideShare
      • and more... (see SanitizeIframeFilter and SanitizeScriptFilter)
  • safe_iframe_url
    • enable iframe url, if use sanitize_use_external
  • safe_script_url
    • enable script url, if use sanitize_use_external

others

PotMarkdown used these filters.

  • HTML::Pipeline::AutolinkFilter
  • HTML::Pipeline::EmojiFilter
  • HTML::Pipeline::MentionFilter

please see html-pipeline documents :)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rutan/pot_markdown