Skip to content

Commit 3472342

Browse files
ParadoxV5haines
andcommitted
Support Commonmarker (lowercase m) from v1.x
Fixes lsegal#1528 Co-Authored-By: Andrew Haines <andrew@haines.org.nz>
1 parent 2c0bac2 commit 3472342

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

lib/yard/templates/helpers/html_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def html_markup_markdown(text)
8989
:tables,
9090
:with_toc_data,
9191
:no_intraemphasis).to_html
92+
when 'Commonmarker'
93+
Commonmarker.to_html(text) # GFM configs are on by default
9294
when 'CommonMarker'
9395
CommonMarker.render_html(text, %i[DEFAULT GITHUB_PRE_LANG], %i[autolink table])
9496
else

lib/yard/templates/helpers/markup_helper.rb

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def clear_markup_cache
3030
{:lib => :maruku, :const => 'Maruku'},
3131
{:lib => :'rpeg-markdown', :const => 'PEGMarkdown'},
3232
{:lib => :rdoc, :const => 'YARD::Templates::Helpers::Markup::RDocMarkdown'},
33+
{:lib => :commonmarker, :const => 'Commonmarker'},
3334
{:lib => :commonmarker, :const => 'CommonMarker'}
3435
],
3536
:textile => [

spec/templates/helpers/html_helper_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def options
158158

159159
it "creates tables (markdown specific)" do
160160
log.enter_level(Logger::FATAL) do
161-
supports_table = %w(RedcarpetCompat Kramdown::Document CommonMarker)
161+
supports_table = %w(RedcarpetCompat Kramdown::Document Commonmarker CommonMarker)
162162
unless supports_table.include?(markup_class(:markdown).to_s)
163163
pending "This test depends on a markdown engine that supports tables"
164164
end

spec/templates/markup_processor_integrations/markdown_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
end
8383
end
8484

85-
describe 'CommonMarker', if: RUBY_VERSION >= '2.3' do
85+
describe 'Commonmarker', if: RUBY_VERSION >= '2.3' do
8686
let(:markup) { :markdown }
8787
let(:markup_provider) { :commonmarker }
8888

0 commit comments

Comments
 (0)