File tree Expand file tree Collapse file tree
lib/yard/templates/helpers
spec/templates/markup_processor_integrations Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33- Add support for Ruby .rbs files (docstrings included) (#1673 )
44- Add built-in hybrid RDoc/Markdown renderer (` HybridMarkdown ` ) requiring no external gems (#1674 )
55- Add support for ` #- ` as a comment-block separator. See Getting Started Guide.
6+ - Add support for ` commonmarker ` version ` >= 1.0 ` .
67- Remove usage of jQuery in default templates. jQuery library is still packaged in templates for backward compatibility (#1675 )
78- Fix false self-referential mixin when bare name matches ancestor namespace (#1672 )
89- Fix bracket/brace map corruption from Ruby 3.0+ pattern matching deconstruction (#1671 )
Original file line number Diff line number Diff line change @@ -93,10 +93,16 @@ def html_markup_markdown(text)
9393 :tables ,
9494 :with_toc_data ,
9595 :no_intraemphasis ) . to_html
96+ when 'Commonmarker'
97+ provider . to_html ( text , :options => { } , :plugins => { :syntax_highlighter => nil } )
9698 when 'CommonMarker'
97- CommonMarker . render_html ( text , %i[ DEFAULT GITHUB_PRE_LANG ] , %i[ autolink table ] )
99+ provider . render_html ( text , %i[ DEFAULT GITHUB_PRE_LANG ] , %i[ autolink table ] )
98100 else
99- provider . new ( text ) . to_html
101+ if provider . respond_to? ( :to_html )
102+ provider . to_html ( text )
103+ else
104+ provider . new ( text ) . to_html
105+ end
100106 end
101107 end
102108
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def clear_markup_cache
3131 { :lib => :maruku , :const => 'Maruku' } ,
3232 { :lib => :'rpeg-markdown' , :const => 'PEGMarkdown' } ,
3333 { :lib => :rdoc , :const => 'YARD::Templates::Helpers::Markup::RDocMarkdown' } ,
34- { :lib => :commonmarker , :const => 'CommonMarker' }
34+ { :lib => :commonmarker , :const => defined? ( CommonMarker ) ? 'CommonMarker' : 'Commonmarker' }
3535 ] ,
3636 :textile => [
3737 { :lib => :redcloth , :const => 'RedCloth' }
Original file line number Diff line number Diff line change 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
8989 include_examples 'shared examples for markdown processors'
9090
91- it 'generates level 2 header without id' do
92- expect ( rendered_document ) . to include ( '<h2>Example code listings</h2>' )
93- end
94-
9591 it 'creates line break via backslash' do
9692 expect ( rendered_document ) . to include ( "commonmark line break with<br />\n a backslash" )
9793 end
You can’t perform that action at this time.
0 commit comments