diff --git a/apipie-rails.gemspec b/apipie-rails.gemspec index 6063dc63..c855a2fb 100644 --- a/apipie-rails.gemspec +++ b/apipie-rails.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |s| s.add_dependency "activesupport", ">= 5.0" # Optional dependencies - s.add_development_dependency "maruku" # for Markdown support + s.add_development_dependency "commonmarker" # for Markdown support s.add_development_dependency "RedCloth" # for Textile support # Dev/tests only dependencies diff --git a/lib/apipie/markup.rb b/lib/apipie/markup.rb index 40e751c0..e5196ff1 100644 --- a/lib/apipie/markup.rb +++ b/lib/apipie/markup.rb @@ -27,11 +27,25 @@ def rdoc class Markdown def initialize - require 'maruku' + require 'commonmarker' end def to_html(text) - Maruku.new(text).to_html + Commonmarker.to_html(text, options: { + parse: { smart: true }, + render: { + hardbreaks: false, + unsafe: false, + escape: true + }, + extension: { + strikethrough: true, + tagfilter: true, + table: true, + autolink: true, + tasklist: true + } + }) end end