diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index 8da19cf2e2..4d6c038deb 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -1779,9 +1779,9 @@ class RDoc::Parser::Ruby < RDoc::Parser while tk and (:on_comment == tk[:kind] or :on_embdoc == tk[:kind]) do comment_body = retrieve_comment_body(tk) comment += comment_body - comment += "\n" unless "\n" == comment_body.chars.to_a.last + comment << "\n" unless comment_body =~ /\n\z/ - if comment_body.size > 1 && "\n" == comment_body.chars.to_a.last then + if comment_body.size > 1 && comment_body =~ /\n\z/ then skip_tkspace_without_nl # leading spaces end tk = get_tk