Skip to content

Commit

Permalink
[ruby/rdoc] Fix formatting blockquote in verbatim
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and matzbot committed Jul 29, 2022
1 parent 0d68286 commit f29f1d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rdoc/markup/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ def build_verbatim margin
line << ' ' * indent
when :BREAK, :TEXT then
line << data
when :BLOCKQUOTE then
line << '>>>'
else # *LIST_TOKENS
list_marker = case type
when :BULLET then data
Expand Down
11 changes: 11 additions & 0 deletions test/rdoc/test_rdoc_markup_to_html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,17 @@ def test_list_verbatim_2
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',
Expand Down

0 comments on commit f29f1d2

Please sign in to comment.