From e74ac71410d187251989765d7ed575de91428c8b Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 5 May 2026 14:10:29 +0200 Subject: [PATCH] Remove `ruby-title` class It was added for sdoc in https://github.com/ruby/rdoc/commit/acc499bad1984aeb4589334b4b434cb59df992ae But since https://github.com/rails/sdoc/commit/41a790bad5fb95d10103342dee7a9c8b89880a2b it doesn't use it anymore, and rdoc has no use for it as well. --- lib/rdoc/token_stream.rb | 11 ----------- test/rdoc/markup/to_html_test.rb | 10 +++++----- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/lib/rdoc/token_stream.rb b/lib/rdoc/token_stream.rb index abf5fc0980..cc89397c60 100644 --- a/lib/rdoc/token_stream.rb +++ b/lib/rdoc/token_stream.rb @@ -15,8 +15,6 @@ module RDoc::TokenStream # with the given class names. Other token types are not wrapped in spans. def self.to_html(token_stream) - starting_title = false - token_stream.map do |t| next unless t @@ -47,15 +45,6 @@ def self.to_html(token_stream) text = t[:text] - if :on_ident == t[:kind] && starting_title - starting_title = false - style = 'ruby-identifier ruby-title' - end - - if :on_kw == t[:kind] and 'def' == t[:text] - starting_title = true - end - text = CGI.escapeHTML text if style then diff --git a/test/rdoc/markup/to_html_test.rb b/test/rdoc/markup/to_html_test.rb index 26d224eac2..820c8c2597 100644 --- a/test/rdoc/markup/to_html_test.rb +++ b/test/rdoc/markup/to_html_test.rb @@ -568,7 +568,7 @@ def bar expected = <<-'EXPECTED' -
def foo +def foo [ '\\', '\'', @@ -588,7 +588,7 @@ def bar /#{}/ ] end -def bar +def bar endEXPECTED @@ -618,7 +618,7 @@ def bar expected = <<-'EXPECTED' -def foo +def foo [ `\\`, `\'\"\``, @@ -628,7 +628,7 @@ def bar `#{}` ] end -def bar +def bar endEXPECTED @@ -702,7 +702,7 @@ def test_accept_verbatim_redefinable_operators %w[| ^ & <=> == === =~ > >= < <= << >> + - * / % ** ~ +@ -@ [] []= ` ! != !~].each do |html_escaped_op| expected += <<-EXPECTED -def #{html_escaped_op} +def #{html_escaped_op} end EXPECTED end