summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup/simple_markup/preprocess.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/markup/simple_markup/preprocess.rb')
-rw-r--r--lib/rdoc/markup/simple_markup/preprocess.rb7
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 bbbae1b77c..101c9bdeb1 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}'"
''