From 23d081b993746ffe47d2f42266e4b7856f2450c3 Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 19 Feb 2004 03:23:51 +0000 Subject: Fix typos (Doug Kearns) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/markup/simple_markup/preprocess.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/rdoc/markup/simple_markup') diff --git a/lib/rdoc/markup/simple_markup/preprocess.rb b/lib/rdoc/markup/simple_markup/preprocess.rb index dbf4b216ca..08ac66139b 100644 --- a/lib/rdoc/markup/simple_markup/preprocess.rb +++ b/lib/rdoc/markup/simple_markup/preprocess.rb @@ -45,7 +45,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}'" '' -- cgit v1.2.3