File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 3333 'idprefix' => '' ,
3434 'idseparator' => '-' ,
3535 'sectanchors' => nil ,
36- 'docname' => File . basename ( filename , ( extname = File . extname ( filename ) ) ) ,
37- 'docfilesuffix' => extname ,
38- 'outfilesuffix' => extname ,
3936 'env' => 'github' ,
4037 'env-github' => '' ,
4138 'source-highlighter' => 'html-pipeline'
4239 }
40+ if filename
41+ attributes [ 'docname' ] = File . basename ( filename , ( extname = File . extname ( filename ) ) )
42+ attributes [ 'docfilesuffix' ] = attributes [ 'outfilesuffix' ] = extname
43+ else
44+ attributes [ 'outfilesuffix' ] = '.adoc'
45+ end
4346 Asciidoctor ::Compliance . unique_id_start_index = 1
4447 Asciidoctor . convert ( content , :safe => :secure , :attributes => attributes )
4548end
Original file line number Diff line number Diff line change @@ -94,7 +94,10 @@ def test_each_render_has_a_name
9494 end
9595
9696 def test_rendering_by_symbol
97- assert_equal '<p><code>test</code></p>' , GitHub ::Markup . render_s ( GitHub ::Markups ::MARKUP_MARKDOWN , '`test`' ) . strip
97+ markup = '`test`'
98+ result = /<p><code>test<\/ code><\/ p>/
99+ assert_match result , GitHub ::Markup . render_s ( GitHub ::Markups ::MARKUP_MARKDOWN , markup ) . strip
100+ assert_match result , GitHub ::Markup . render_s ( GitHub ::Markups ::MARKUP_ASCIIDOC , markup ) . split . join
98101 end
99102
100103 def test_raises_error_if_command_exits_non_zero
You can’t perform that action at this time.
0 commit comments