Bug #3512

ri shows '__send__' incorrectly

Added by Tomo Kazahaya about 5 years ago. Updated about 4 years ago.

Status:Closed
Priority:Normal
Assignee:Eric Hodel
ruby -v:ruby 1.9.3dev (2010-07-01 trunk 28495) [i686-linux] Backport:

Description

=begin
Since '' is used as a word-based markup for emphasizing, Ri description of Object#send_ is broken:

% ri Object#send
Object#send

(from ruby core)


obj.send(symbol [, args...]) -> obj
obj.send(symbol [, args...]) -> obj


Invokes the method identified by symbol, passing it any arguments
specified. You can use send if the name send clashes with <-- should be 'can use send'
an existing method in obj.

class Klass
def hello(*args)
"Hello " + args.join(' ')
end
end
k = Klass.new
k.send :hello, "gentle", "readers" #=> "Hello gentle readers"

Following will fix the problem:

% git diff
diff --git a/lib/rdoc/markup/attribute_manager.rb b/lib/rdoc/markup/attribute_ma
index 5b9e070..37014b6 100644
--- a/lib/rdoc/markup/attribute_manager.rb
+++ b/lib/rdoc/markup/attribute_manager.rb
@@ -112,7 +112,7 @@ class RDoc::Markup::AttributeManager
# first do matching ones
tags = @matching_word_pairs.keys.join("")

  • re = /(|\W)([#{tags}])([#:\]?[\w.\/-]+?\S?)\2(\W|$)/
  • re = /(|[\w#{NULL}])([#{tags}])([#:\]?[\w.\/-]+?\S?)\2(\W|$)/

    1 while str.gsub!(re) do
    attr = @matching_word_pairs[$2]
    @@ -228,8 +228,8 @@ class RDoc::Markup::AttributeManager

    @attrs = RDoc::Markup::AttrSpan.new @str.length

  • convert_attrs @str, @attrs
    convert_html @str, @attrs

  • convert_attrs @str, @attrs
    convert_specials @str, @attrs

    unmask_protected_sequences
    =end

Associated revisions

Revision 28647
Added by tenderlove almost 5 years ago

  • lib/rdoc/markup/attribute_manager.rb: fixing ri output when special characters are inside html tags. Thanks Tomo Kazahaya! [Bug #3512]
  • test/rdoc/test_attribute_manager.rb: corresponding test.

Revision 28647
Added by tenderlove almost 5 years ago

  • lib/rdoc/markup/attribute_manager.rb: fixing ri output when special characters are inside html tags. Thanks Tomo Kazahaya! [Bug #3512]
  • test/rdoc/test_attribute_manager.rb: corresponding test.

History

#1 Updated by Aaron Patterson almost 5 years ago

  • Assignee set to Eric Hodel

=begin

=end

#2 Updated by Anonymous almost 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r28647.
Tomo, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF