Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apipie-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 16 additions & 2 deletions lib/apipie/markup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading