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 33
33
'idprefix' => '' ,
34
34
'idseparator' => '-' ,
35
35
'sectanchors' => nil ,
36
- 'docname' => File . basename ( filename , ( extname = File . extname ( filename ) ) ) ,
37
- 'docfilesuffix' => extname ,
38
- 'outfilesuffix' => extname ,
39
36
'env' => 'github' ,
40
37
'env-github' => '' ,
41
38
'source-highlighter' => 'html-pipeline'
42
39
}
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
43
46
Asciidoctor ::Compliance . unique_id_start_index = 1
44
47
Asciidoctor . convert ( content , :safe => :secure , :attributes => attributes )
45
48
end
Original file line number Diff line number Diff line change @@ -94,7 +94,10 @@ def test_each_render_has_a_name
94
94
end
95
95
96
96
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
98
101
end
99
102
100
103
def test_raises_error_if_command_exits_non_zero
You can’t perform that action at this time.
0 commit comments