diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-10 01:20:24 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-10 01:20:24 +0000 |
commit | bcdcc6099a682f5a558d493a5a91c48c694070f0 (patch) | |
tree | e35b79c392e64df3d524054b0db4be39bf04dbbd /lib/rdoc | |
parent | 68043e4379705b4e6f9a93bcba046ece61bfc73a (diff) | |
download | ruby-bcdcc6099a682f5a558d493a5a91c48c694070f0.tar.gz ruby-bcdcc6099a682f5a558d493a5a91c48c694070f0.tar.xz ruby-bcdcc6099a682f5a558d493a5a91c48c694070f0.zip |
* lib/getoptlong.rb (GetoptLong#set_options): recieve arguments
as Array.
* lib/irb/slex.rb: use Proc#yield.
* lib/rdoc/markup/simple_markup/inline.rb: follow the new behavior
of String#[].
* lib/rdoc/ri/ri_write.rb: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc')
-rw-r--r-- | lib/rdoc/markup/simple_markup/inline.rb | 8 | ||||
-rw-r--r-- | lib/rdoc/ri/ri_writer.rb | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/rdoc/markup/simple_markup/inline.rb b/lib/rdoc/markup/simple_markup/inline.rb index 1e76c201c..9ca585735 100644 --- a/lib/rdoc/markup/simple_markup/inline.rb +++ b/lib/rdoc/markup/simple_markup/inline.rb @@ -183,7 +183,7 @@ module SM unless SPECIAL.empty? SPECIAL.each do |regexp, attr| str.scan(regexp) do - attrs.set_attrs($`.length, $1.length, attr | Attribute::SPECIAL) + attrs.set_attrs($`.length, $&.length, attr | Attribute::SPECIAL) end end end @@ -215,6 +215,8 @@ module SM add_html("b", :BOLD) add_html("tt", :TT) add_html("code", :TT) + + add_special(/<!--(.*?)-->/, :COMMENT) end def add_word_pair(start, stop, name) @@ -293,7 +295,7 @@ module SM # skip leading invisible text i = 0 - i += 1 while i < str_len and @str[i].zero? + i += 1 while i < str_len and @str[i] == "\0" start_pos = i # then scan the string, chunking it on attribute changes @@ -319,7 +321,7 @@ module SM # move on, skipping any invisible characters begin i += 1 - end while i < str_len and @str[i].zero? + end while i < str_len and @str[i] == "\0" end # tidy up trailing text diff --git a/lib/rdoc/ri/ri_writer.rb b/lib/rdoc/ri/ri_writer.rb index 78c68e840..f1042fba7 100644 --- a/lib/rdoc/ri/ri_writer.rb +++ b/lib/rdoc/ri/ri_writer.rb @@ -13,7 +13,7 @@ module RI # by %xx) def RiWriter.internal_to_external(name) - name.gsub(/\W/) { sprintf("%%%02x", $&[0]) } + name.gsub(/\W/) { "%%%02x" % $&[0].unpack('C') } end # And the reverse operation |