diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-01-21 19:43:02 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-01-24 16:46:17 +0900 |
commit | b88d1e6b44164bca0c2b85ea6639469813e1e1d8 (patch) | |
tree | ebe3b2332ba8e2ec1660b0dbfe2072c416e74f52 | |
parent | bb570ce6d80d28cfc7131dcb72885eed2f989b30 (diff) |
[ruby/rdoc] Make each commit entries h3
https://github.com/ruby/rdoc/commit/11eefb2ae9
-rw-r--r-- | lib/rdoc/parser/changelog.rb | 12 | ||||
-rw-r--r-- | test/rdoc/test_rdoc_parser_changelog.rb | 12 |
2 files changed, 10 insertions, 14 deletions
diff --git a/lib/rdoc/parser/changelog.rb b/lib/rdoc/parser/changelog.rb index 3634b6a6eb..763ba03d2c 100644 --- a/lib/rdoc/parser/changelog.rb +++ b/lib/rdoc/parser/changelog.rb @@ -226,13 +226,13 @@ class RDoc::Parser::ChangeLog < RDoc::Parser def create_entries entries # git log entries have no strictly itemized style like the old # style, just assume Markdown. - entries.map do |entry, (author, date, body)| - list = RDoc::Markup::List.new(:NOTE) - author = RDoc::Markup::Paragraph.new(author) - list << RDoc::Markup::ListItem.new(date, author) - RDoc::Markdown.parse(body).parts.each {|b| list << b} - list + out = [] + entries.each do |entry, (author, date, body)| + title = RDoc::Markup::Heading.new(3, "#{date} #{author}") + out << title + out.concat RDoc::Markdown.parse(body).parts end + out end end end diff --git a/test/rdoc/test_rdoc_parser_changelog.rb b/test/rdoc/test_rdoc_parser_changelog.rb index 33e59ac077..220f008aec 100644 --- a/test/rdoc/test_rdoc_parser_changelog.rb +++ b/test/rdoc/test_rdoc_parser_changelog.rb @@ -349,16 +349,12 @@ ChangeLog blank_line, head(2, '2021-01-21'), blank_line, - list(:NOTE, - item('2021-01-21 01:03:52 +0900', - para('git <[email protected]>')), - list(:BULLET, item(nil, para('2021-01-21 [ci skip]')))), + head(3, '2021-01-21 01:03:52 +0900 git <[email protected]>'), + list(:BULLET, item(nil, para('2021-01-21 [ci skip]'))), head(2, '2021-01-20'), blank_line, - list(:NOTE, - item('2021-01-20 01:58:26 +0900', - para('git <[email protected]>')), - list(:BULLET, item(nil, para('2021-01-20 [ci skip]'))))) + head(3, '2021-01-20 01:58:26 +0900 git <[email protected]>'), + list(:BULLET, item(nil, para('2021-01-20 [ci skip]')))) expected.file = @top_level |