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/simple_markup/preprocess.rb | |
| 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/simple_markup/preprocess.rb')
| -rw-r--r-- | lib/rdoc/markup/simple_markup/preprocess.rb | 7 |
1 files changed, 6 insertions, 1 deletions
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}'" '' |
