Skip to content

Commit 1ae47bb

Browse files
authored
Merge pull request #530 from aycabta/fix-code-fence
Fix CodeFence with unintended Array for format
2 parents 2a20c9f + 07492e9 commit 1ae47bb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/rdoc/markdown.kpeg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ CodeFence = &{ github? }
11611161
@Newline
11621162
)+ > Ticks3 @Sp @Newline*
11631163
{ verbatim = RDoc::Markup::Verbatim.new text
1164-
verbatim.format = format.intern if format
1164+
verbatim.format = format.intern if format.instance_of?(String)
11651165
verbatim
11661166
}
11671167

test/test_rdoc_markdown.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,14 @@ def test_strong
973973
assert_equal '<b>_emphasis_</b>', @parser.strong('_emphasis_')
974974
end
975975

976+
def test_code_fence_with_unintended_array
977+
doc = parse '```<ruby>```'
978+
979+
expected = doc(verb('<ruby>'))
980+
981+
assert_equal expected, doc
982+
end
983+
976984
def parse text
977985
@parser.parse text
978986
end

0 commit comments

Comments
 (0)