Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions lib/rdoc/token_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions test/rdoc/markup/to_html_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def bar

expected = <<-'EXPECTED'

<pre class="ruby"><span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">foo</span>
<pre class="ruby"><span class="ruby-keyword">def</span> <span class="ruby-identifier">foo</span>
[
<span class="ruby-string">&#39;\\&#39;</span>,
<span class="ruby-string">&#39;\&#39;&#39;</span>,
Expand All @@ -588,7 +588,7 @@ def bar
<span class="ruby-regexp">/#{}/</span>
]
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bar</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">bar</span>
<span class="ruby-keyword">end</span>
</pre>
EXPECTED
Expand Down Expand Up @@ -618,7 +618,7 @@ def bar

expected = <<-'EXPECTED'

<pre class="ruby"><span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">foo</span>
<pre class="ruby"><span class="ruby-keyword">def</span> <span class="ruby-identifier">foo</span>
[
<span class="ruby-string">`\\`</span>,
<span class="ruby-string">`\&#39;\&quot;\``</span>,
Expand All @@ -628,7 +628,7 @@ def bar
<span class="ruby-node">`#{}`</span>
]
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bar</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">bar</span>
<span class="ruby-keyword">end</span>
</pre>
EXPECTED
Expand Down Expand Up @@ -702,7 +702,7 @@ def test_accept_verbatim_redefinable_operators

%w[| ^ &amp; &lt;=&gt; == === =~ &gt; &gt;= &lt; &lt;= &lt;&lt; &gt;&gt; + - * / % ** ~ +@ -@ [] []= ` ! != !~].each do |html_escaped_op|
expected += <<-EXPECTED
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">#{html_escaped_op}</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">#{html_escaped_op}</span>
<span class="ruby-keyword">end</span>
EXPECTED
end
Expand Down
Loading