lib/yard/templates/helpers/html_helper.rb in yard-0.9.26 vs lib/yard/templates/helpers/html_helper.rb in yard-0.9.27
- old
+ new
@@ -76,19 +76,22 @@
# @return [String] output HTML
# @since 0.6.0
def html_markup_markdown(text)
# TODO: other libraries might be more complex
provider = markup_class(:markdown)
- if provider.to_s == 'RDiscount'
+ case provider.to_s
+ when 'RDiscount'
provider.new(text, :autolink).to_html
- elsif provider.to_s == 'RedcarpetCompat'
+ when 'RedcarpetCompat'
provider.new(text, :autolink,
:fenced_code,
:gh_blockcode,
:lax_spacing,
:tables,
:with_toc_data,
:no_intraemphasis).to_html
+ when 'CommonMarker'
+ CommonMarker.render_html(text, %i[DEFAULT GITHUB_PRE_LANG], %i[autolink])
else
provider.new(text).to_html
end
end