lib/github_api/markdown.rb in github_api-0.9.7 vs lib/github_api/markdown.rb in github_api-0.10.0
- old
+ new
@@ -26,15 +26,16 @@
#
def render(*args)
arguments(args) do
assert_required ['text']
end
+ params = arguments.params
+ params['raw'] = true
- post_request("markdown", arguments.params, :raw => true)
+ post_request("markdown", arguments.params)
end
-
# Render a Markdown document in raw mode
#
# = Input
# The raw API it not JSON-based. It takes a Markdown document as plaintext
# <tt>text/plain</tt> or <tt>text/x-markdown</tt> and renders it as plain
@@ -42,17 +43,18 @@
# rendered – this is the simplest way to preview a readme online)
#
# = Examples
# github = Github.new
# github.markdown.render_raw "Hello github/linguist#1 **cool**, and #1!",
- # "mime": "text/plain",
+ # "accept": "text/plain",
#
def render_raw(*args)
params = arguments(args).params
mime_type, params['data'] = params['mime'], args.shift
+ params['raw'] = true
+ params['accept'] = params.fetch('accept') { 'text/plain' }
- post_request("markdown/raw", params, :raw => true,
- :headers => {'Content-Type' => mime_type || 'text/plain'})
+ post_request("markdown/raw", params)
end
end # Markdown
end # Github