Skip to content

Use GitHub Flavored Markdown for parsing the markdown #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2014
Merged
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 Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "http://rubygems.org"

gem 'grape', '>= 0.2.0'
gem 'grape-entity', '~> 0.3.0'
gem 'kramdown'
gem 'github-markdown'

# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ GEM
diff-lcs (1.1.3)
ffi (1.9.3-java)
git (1.2.5)
github-markdown (0.6.4)
grape (0.5.0)
activesupport
builder
Expand All @@ -33,7 +34,6 @@ GEM
rdoc
json (1.7.3)
json (1.7.3-java)
kramdown (0.13.7)
method_source (0.8)
multi_json (1.7.7)
multi_xml (0.5.4)
Expand Down Expand Up @@ -83,10 +83,10 @@ PLATFORMS

DEPENDENCIES
bundler (> 1.0.0)
github-markdown
grape (>= 0.2.0)
grape-entity (~> 0.3.0)
jeweler (~> 1.8.4)
kramdown
pry
rack-test
rdoc (~> 3.12)
Expand Down
4 changes: 2 additions & 2 deletions lib/grape-swagger.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'kramdown'
require 'github/markdown'

module Grape
class API
Expand Down Expand Up @@ -167,7 +167,7 @@ def self.setup(options)
helpers do

def as_markdown(description)
description && @@markdown ? Kramdown::Document.new(strip_heredoc(description)).to_html : description
description && @@markdown ? GitHub::Markdown.render_gfm(strip_heredoc(description)) : description
end

def parse_params(params, path, method)
Expand Down