diff options
| author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-26 20:44:14 +0000 |
|---|---|---|
| committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-26 20:44:14 +0000 |
| commit | edfba216e791385346ae7f1cfab012b74a6cd816 (patch) | |
| tree | 03e7986b60a2ef8aca427d12f0288e8b09339f55 /lib/rdoc/markup | |
| parent | 3616c236b62dc9d80eb114cfce92399e9a093986 (diff) | |
| download | ruby-edfba216e791385346ae7f1cfab012b74a6cd816.tar.gz ruby-edfba216e791385346ae7f1cfab012b74a6cd816.tar.xz ruby-edfba216e791385346ae7f1cfab012b74a6cd816.zip | |
Merge from HEAD.
Add --system, --site, --home, --gems to ri.
Allow --doc-dir to be specified multiple times.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/markup')
| -rw-r--r-- | lib/rdoc/markup/simple_markup/inline.rb | 4 | ||||
| -rw-r--r-- | lib/rdoc/markup/simple_markup/preprocess.rb | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/rdoc/markup/simple_markup/inline.rb b/lib/rdoc/markup/simple_markup/inline.rb index 1e76c201c..d54fe1e66 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) diff --git a/lib/rdoc/markup/simple_markup/preprocess.rb b/lib/rdoc/markup/simple_markup/preprocess.rb index bbbae1b77..101c9bdeb 100644 --- a/lib/rdoc/markup/simple_markup/preprocess.rb +++ b/lib/rdoc/markup/simple_markup/preprocess.rb @@ -43,7 +43,12 @@ module SM def include_file(name, indent) if (full_name = find_include_file(name)) content = File.open(full_name) {|f| f.read} - res = content.gsub(/^#?/, indent) + # strip leading '#'s, but only if all lines start with them + if content =~ /^[^#]/ + content.gsub(/^/, indent) + else + content.gsub(/^#?/, indent) + end else $stderr.puts "Couldn't find file to include: '#{name}'" '' |
