Merge pull request #2792 from hennevogel/bugfix/2764
Switch to fenced code blocks in markdown
This commit is contained in:
commit
b8661dc575
2 changed files with 6 additions and 4 deletions
|
|
@ -191,9 +191,11 @@ module FormatHelper
|
|||
return '' if text.nil?
|
||||
|
||||
options = {
|
||||
autolink: true,
|
||||
space_after_headers: true,
|
||||
no_intra_emphasis: true
|
||||
autolink: true,
|
||||
space_after_headers: true,
|
||||
no_intra_emphasis: true,
|
||||
fenced_code_blocks: true,
|
||||
disable_indented_code_blocks: true
|
||||
}
|
||||
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(escape_html: escape_html), options)
|
||||
markdown.render(text).html_safe
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ describe FormatHelper, type: :helper do
|
|||
|
||||
it 'should return HTML for header markdown' do
|
||||
expect(Redcarpet::Markdown).to receive(:new)
|
||||
.with(Redcarpet::Render::HTML, autolink: true, space_after_headers: true, no_intra_emphasis: true)
|
||||
.with(Redcarpet::Render::HTML, autolink: true, space_after_headers: true, no_intra_emphasis: true, fenced_code_blocks: true, disable_indented_code_blocks: true)
|
||||
.and_call_original
|
||||
|
||||
expect(markdown('# this is my header')).to eq "<h1>this is my header</h1>\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue