Commit f04952ad authored by Stan Hu's avatar Stan Hu

Merge branch 'fj-render-kramdown-through-gitlab-markup' into 'master'

Render Kramdown through Gitlab Markup

See merge request gitlab-org/gitlab!56750
parents 8a2b4545 ad4a7089
---
title: Render Kramdown format using Gitlab markup
merge_request: 56750
author:
type: changed
......@@ -4,7 +4,7 @@ module Gitlab
module MarkupHelper
extend self
MARKDOWN_EXTENSIONS = %w[mdown mkd mkdn md markdown].freeze
MARKDOWN_EXTENSIONS = %w[mdown mkd mkdn md markdown rmd].freeze
ASCIIDOC_EXTENSIONS = %w[adoc ad asciidoc].freeze
OTHER_EXTENSIONS = %w[textile rdoc org creole wiki mediawiki rst].freeze
EXTENSIONS = MARKDOWN_EXTENSIONS + ASCIIDOC_EXTENSIONS + OTHER_EXTENSIONS
......
......@@ -382,6 +382,27 @@ RSpec.describe MarkupHelper do
end
end
context 'when file is Kramdown' do
let(:extension) { 'rmd' }
let(:content) do
<<-EOF
{::options parse_block_html="true" /}
<div>
FooBar
</div>
EOF
end
it 'renders using #markdown_unsafe helper method' do
expect(helper).to receive(:markdown_unsafe).with(content, context)
result = helper.render_wiki_content(wiki)
expect(result).to be_empty
end
end
context 'any other format' do
let(:extension) { 'foo' }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment