summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-26 20:44:14 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-26 20:44:14 +0000
commit4e23c46ff4c2b6fb8c16a50b7123acb753f7b7d6 (patch)
tree03e7986b60a2ef8aca427d12f0288e8b09339f55 /lib/rdoc/markup
parent74831046c7240243c57efec65c11e2e71a9287f4 (diff)
Merge from HEAD.
Add --system, --site, --home, --gems to ri. Allow --doc-dir to be specified multiple times. git-svn-id: svn+ssh://ci.ruby-lang.org/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.rb4
-rw-r--r--lib/rdoc/markup/simple_markup/preprocess.rb7
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 1e76c201c9..d54fe1e667 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 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}'"
''