1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/rdoc] Fix formatting blockquote in verbatim

Reported at https://github.com/ruby/rdoc/pull/907#discussion_r932505816

https://github.com/ruby/rdoc/commit/86384ac7f9
This commit is contained in:
Nobuyoshi Nakada 2022-07-29 09:10:36 +09:00 committed by git
parent 0d68286be9
commit f29f1d22c3
2 changed files with 13 additions and 0 deletions

View file

@ -287,6 +287,8 @@ class RDoc::Markup::Parser
line << ' ' * indent
when :BREAK, :TEXT then
line << data
when :BLOCKQUOTE then
line << '>>>'
else # *LIST_TOKENS
list_marker = case type
when :BULLET then data

View file

@ -812,6 +812,17 @@ EXPECTED
assert_equal expected, @m.convert(str, @to)
end
def test_block_quote_in_verbatim
str = "BlockQuote\n >>>\n"
expected = <<-EXPECTED
<p>BlockQuote</p>
<pre>&gt;&gt;&gt;</pre>
EXPECTED
assert_equal expected, @m.convert(str, @to).gsub(/^\n/, "")
end
def test_parseable_eh
valid_syntax = [
'def x() end',