1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2010-07-14 21:13:41 +00:00
parent b782aea75f
commit 1df8d6dbc3
3 changed files with 23 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Thu Jul 15 06:11:29 2010 Aaron Patterson <aaron@tenderlovemaking.com>
* lib/rdoc/markup/attribute_manager.rb: fixing ri output when special
characters are inside html tags. Thanks Tomo Kazahaya! [Bug #3512]
Thu Jul 15 06:01:42 2010 Tanaka Akira <akr@fsij.org>
* time.c (guess_local_offset): use the UTC offset of an older date on

View file

@ -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

View file

@ -11,6 +11,22 @@ class TestAttributeManager < MiniTest::Unit::TestCase
@klass = RDoc::Markup::AttributeManager
end
def test_convert_attrs_ignores_code
collector = RDoc::Markup::AttrSpan.new 10
str = 'foo <code>__send__</code> bar'
@am.convert_html str, collector
@am.convert_attrs str, collector
assert_match(/__send__/, str)
end
def test_convert_attrs_ignores_tt
collector = RDoc::Markup::AttrSpan.new 10
str = 'foo <tt>__send__</tt> bar'
@am.convert_html str, collector
@am.convert_attrs str, collector
assert_match(/__send__/, str)
end
def test_initial_word_pairs
word_pairs = @am.matching_word_pairs
assert word_pairs.is_a?(Hash)